From d3adedf33ede26885c376a35ae32fa46a416880f Mon Sep 17 00:00:00 2001 From: Pranaysagar Bhelave <92773034+pranay2310@users.noreply.github.com> Date: Thu, 11 Jun 2026 22:36:14 +0530 Subject: [PATCH 1/4] Add files via upload --- 2025/kubernetes/solution.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 2025/kubernetes/solution.md diff --git a/2025/kubernetes/solution.md b/2025/kubernetes/solution.md new file mode 100644 index 0000000000..8f24359f20 --- /dev/null +++ b/2025/kubernetes/solution.md @@ -0,0 +1,14 @@ +- Include your Pod YAML + +apiVersion: v1 +kind: Pod +metadata: + name: nginx-pod + labels: + app: nginx +spec: + containers: + - name: nginx + image: nginx:latest + ports: + - containerPort: 80 \ No newline at end of file From 505d34994fef83c75c10e6f9ce94b1902eccfe0d Mon Sep 17 00:00:00 2001 From: pranay2310 Date: Fri, 12 Jun 2026 06:41:35 +0530 Subject: [PATCH 2/4] test --- 2025/kubernetes/solution.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 2025/kubernetes/solution.md diff --git a/2025/kubernetes/solution.md b/2025/kubernetes/solution.md new file mode 100644 index 0000000000..483793cb9e --- /dev/null +++ b/2025/kubernetes/solution.md @@ -0,0 +1,17 @@ +- Include your Pod YAML + +apiVersion: v1 +kind: Pod +metadata: + name: nginx-pod + labels: + app: nginx +spec: + containers: + - name: nginx + image: nginx:latest + ports: + - containerPort: 80 + + + \ No newline at end of file From 72eec815c4909eab0263a5648e30bc06e849f38a Mon Sep 17 00:00:00 2001 From: pranay2310 Date: Sat, 13 Jun 2026 23:21:49 +0530 Subject: [PATCH 3/4] modified pod.yaml content in solution.md --- 2025/kubernetes/solution.md | 100 +++++++++++++++++++++++++++++++++++- 1 file changed, 99 insertions(+), 1 deletion(-) diff --git a/2025/kubernetes/solution.md b/2025/kubernetes/solution.md index 993586b074..3d0e3fd72e 100644 --- a/2025/kubernetes/solution.md +++ b/2025/kubernetes/solution.md @@ -1,6 +1,6 @@ - Include your Pod YAML -apiVersion: v1 +apiVersion: v1ds kind: Pod metadata: name: nginx-pod @@ -30,3 +30,101 @@ spec: image: nginx:latest ports: - containerPort: 80 + +-------------------------------------------------------- + + Create a Dedicated Namespace +Namespaces let you group and isolate Kubernetes resources. Create a namespace called 'first-pod' that will hold everything you build in this lab. +1. Open a shell inside your toolbox container. +2. Run the command to create the namespace. +3. Verify the namespace exists and is Active before moving on. + +-------------------------------------------------------- + + +Deploy Your First Pod +Now deploy a Pod named 'my-nginx' in the 'first-pod' namespace using the official nginx image (nginx:1.25). You will write a simple Pod manifest and apply it with kubectl. +1. Create a file called pod.yaml with the following content: +apiVersion: v1 +kind: Pod +metadata: + name: my-nginx + namespace: first-pod + labels: + app: my-nginx +spec: + containers: + - name: nginx + image: nginx:1.25 + ports: + - containerPort: 80 +Copy +2. Apply the manifest: +kubectl apply -f pod.yaml +✓ + +3. Watch the Pod status until it shows Running: +kubectl get pod my-nginx -n first-pod -w +✓ + +(press Ctrl+C once it shows Running) + +-------------------------------------------------------- + +TASK 3 OF 5 +Done +20 pts +Inspect the Pod with kubectl describe +A running Pod holds a wealth of information. Use 'kubectl describe' to read its full details, then answer the following by examining the output: +1. Run: +kubectl describe pod my-nginx -n first-pod +✓ + +2. Find and note: the Node the Pod was scheduled on, the Pod IP address, the container image, and the Events section at the bottom. +3. Also retrieve just the Pod IP using a jsonpath query: +kubectl get pod my-nginx -n first-pod -o jsonpath='{.status.podIP}' +✓ +The Events section is especially important — it shows exactly what Kubernetes did to start your Pod (Scheduled → Pulling → Pulled → Created → Started). + +-------------------------------------------------------- + +TASK 4 OF 5 +Done +20 pts +Read the Pod Logs +Container logs are your first debugging tool. Retrieve the nginx access and startup logs from your running Pod. +1. Fetch all current logs: +kubectl logs my-nginx -n first-pod +✓ +2. Stream logs live (press Ctrl+C to stop): +kubectl logs my-nginx -n first-pod -f +✓ +3. Show only the last 10 lines: +kubectl logs my-nginx -n first-pod --tail=10 +✓ +You should see nginx startup messages confirming the server is ready. Note the '--tail' and '-f' flags — you will use them constantly when debugging real applications. + +-------------------------------------------------------- +TASK 5 OF 5 +Done +20 pts +Execute a Command Inside the Running Pod +Just like 'docker exec', kubectl lets you run commands inside a running container. Use this to verify nginx is serving content and to explore the container filesystem. +1. Run a one-shot command inside the Pod to check the nginx welcome page: +kubectl exec my-nginx -n first-pod -- curl -s http://localhost:80 +✓ +2. Check the nginx version: +kubectl exec my-nginx -n first-pod -- nginx -v +✓ +3. Open an interactive shell (type 'exit' when done): +kubectl exec -it my-nginx -n first-pod -- /bin/bash +✓ +4. Inside the shell, run: +ls /usr/share/nginx/html +cat /usr/share/nginx/html/index.html +exit +This confirms the Pod is fully operational and you can interact with it just like a local process. +-------------------------------------------------------- + + +-------------------------------------------------------- \ No newline at end of file From 475d5181d7d8b541397b8f9333a7a627fadc4809 Mon Sep 17 00:00:00 2001 From: pranay2310 Date: Sat, 13 Jun 2026 23:25:01 +0530 Subject: [PATCH 4/4] modified pod.yaml content in solution.md --- 2025/kubernetes/solution.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/2025/kubernetes/solution.md b/2025/kubernetes/solution.md index 3d0e3fd72e..8075569832 100644 --- a/2025/kubernetes/solution.md +++ b/2025/kubernetes/solution.md @@ -125,6 +125,3 @@ cat /usr/share/nginx/html/index.html exit This confirms the Pod is fully operational and you can interact with it just like a local process. -------------------------------------------------------- - - --------------------------------------------------------- \ No newline at end of file