Skip to content

Simple Kubernetes App

Deploy a basic nginx application using plain Kubernetes manifests.

Time: ~5 minutes Difficulty: Beginner

  • Creating a Deployment with replicas
  • Exposing pods with a Service
  • Resource requests and limits
  • Inspecting running workloads

Navigate to the demo directory:

Terminal window
cd demos/simple-app

Then apply the manifests:

Terminal window
kubectl apply -f manifests/namespace.yaml
kubectl apply -f manifests/
Terminal window
# Check pods are running
kubectl get pods -n simple-app
# Check the service
kubectl get svc -n simple-app
# Access the app
kubectl port-forward svc/simple-nginx-service 8080:80 -n simple-app

Open http://localhost:8080 in your browser. You should see the default nginx welcome page.

manifests/
deployment.yaml # 2 replicas of nginx:1.25.3-alpine
service.yaml # ClusterIP service on port 80

The 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.

  1. Scale the deployment:

    Terminal window
    kubectl scale deployment simple-nginx --replicas=4 -n simple-app
  2. Watch pods come up:

    Terminal window
    kubectl get pods -n simple-app -w
  3. Delete a pod and watch it get recreated:

    Terminal window
    kubectl delete pod -l app=simple-nginx -n simple-app --wait=false
    kubectl get pods -n simple-app -w
Terminal window
kubectl delete namespace simple-app

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.

Move on to Helm to learn how templating makes manifests reusable.