Simple Kubernetes App
Deploy a basic nginx application using plain Kubernetes manifests.
Time: ~5 minutes Difficulty: Beginner
What You Will Learn
Section titled “What You Will Learn”- Creating a Deployment with replicas
- Exposing pods with a Service
- Resource requests and limits
- Inspecting running workloads
Deploy
Section titled “Deploy”Navigate to the demo directory:
cd demos/simple-appThen apply the manifests:
kubectl apply -f manifests/namespace.yamlkubectl apply -f manifests/Verify
Section titled “Verify”# Check pods are runningkubectl get pods -n simple-app
# Check the servicekubectl get svc -n simple-app
# Access the appkubectl port-forward svc/simple-nginx-service 8080:80 -n simple-appOpen http://localhost:8080 in your browser. You should see the default nginx welcome page.
What is Happening
Section titled “What is Happening”manifests/ deployment.yaml # 2 replicas of nginx:1.25.3-alpine service.yaml # ClusterIP service on port 80The Deployment creates 2 pods running nginx with resource limits (50m CPU, 64Mi memory). The Service provides a stable internal endpoint so other components can reach nginx without knowing which pod handles the request.
Experiment
Section titled “Experiment”-
Scale the deployment:
Terminal window kubectl scale deployment simple-nginx --replicas=4 -n simple-app -
Watch pods come up:
Terminal window kubectl get pods -n simple-app -w -
Delete a pod and watch it get recreated:
Terminal window kubectl delete pod -l app=simple-nginx -n simple-app --wait=falsekubectl get pods -n simple-app -w
Cleanup
Section titled “Cleanup”kubectl delete namespace simple-appFurther Reading
Section titled “Further Reading”See docs/deep-dive.md for a deeper look at how Deployments use ReplicaSets, why Services exist, how labels connect everything, and what happens when you misconfigure resource limits.
Next Step
Section titled “Next Step”Move on to Helm to learn how templating makes manifests reusable.