“Run ONE Web App in Kubernetes and Access It”
If someone understands this project, Kubernetes will finally click.
What you will build
You will run one containerized web app in Kubernetes and access it from your browser.
Browser → Service → Pod → Container
here we see:
- What a Pod is
- Why Kubernetes exists
- How traffic reaches a container
- Why Kubernetes networking is different from Docker
If this is not clear → nothing else will be clear.
PROJECT GOAL
✔ Run an app in Kubernetes
✔ Expose it
✔ Open it in a browser
✔ Understand each step
REQUIREMENTS
- Minikube (local Kubernetes)
- kubectl
- Docker installed
STEP 1 — Start Kubernetes (Minikube)
minikube start
Verify:
kubectl get nodes
Expected:
NAME STATUS ROLES AGE VERSION
minikube Ready control-plane ...
Why:
Kubernetes always runs workloads on nodes.
STEP 2 — Create a Pod (Smallest Kubernetes unit)
Create file: pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: hello-pod
labels:
app: hello
spec:
containers:
- name: hello-container
image: nginx
ports:
- containerPort: 80
Apply it:
kubectl apply -f pod.yaml
Check:
kubectl get pods
Why:
A Pod is the smallest thing Kubernetes runs — not a container.
STEP 3 — Verify Pod is Running
kubectl describe pod hello-pod
Key things to notice:
- Pod IP
- Container status
- Events
Explain to students:
Kubernetes assigned an IP, started the container, and is monitoring it.
STEP 4 — Create a Service (Expose the Pod)
Create file: service.yaml
apiVersion: v1
kind: Service
metadata:
name: hello-service
spec:
type: NodePort
selector:
app: hello
ports:
- port: 80
targetPort: 80
nodePort: 30007
Apply:
kubectl apply -f service.yaml
Check:
kubectl get svc
Why:
Pod IPs are not stable.
Services provide stable access.
STEP 5 — Access from Browser
Run:
minikube ip
Open browser:
http://<MINIKUBE_IP>:30007
You should see:
Welcome to nginx!
This is Kubernetes working.
STEP 6 — Prove Kubernetes Self-Healing (Key Concept)
Delete the Pod:
kubectl delete pod hello-pod
Check:
kubectl get pods
Result:
❌ Pod is gone
❌ Service has nothing to route to
Explain:
This is why Pods alone are NOT production-ready.
WHAT YOU LEARNED (This is huge)
| Concept | You now understand |
|---|---|
| Pod | Smallest unit |
| Service | Stable networking |
| NodePort | External access |
| Labels | How Services find Pods |
| Why Deployments exist | Pods die |
VERY IMPORTANT REALIZATION
Kubernetes did not recreate the Pod
That’s why we need Deployments next



Top comments (0)