Kubernetes Fundamentals

Lesson 6 of 6

Final Project: Deploy a Multi-Tier App to Kubernetes

Put every piece together: Deployments, Services, config, and real kubectl usage, applied to an actual multi-tier application.

Requirements

  1. Containerize a simple app with at least two tiers (e.g. a web/API service and a database, or a frontend and a backend), each with its own Dockerfile.
  2. Write a Deployment + Service for each tier, the backend/API's Service should be ClusterIP (internal only), the frontend's should be exposed (NodePort or LoadBalancer, depending on your cluster).
  3. Externalize at least one piece of configuration into a ConfigMap and one credential into a Secret, referenced by your Deployments rather than hardcoded.
  4. Deploy everything to a local cluster (minikube or kind) using kubectl apply -f, and confirm the frontend can actually reach the backend through its Service DNS name.
  5. Perform a rolling update, change something in your app, rebuild the image, bump the tag, and re-apply, then verify with kubectl rollout status that it completed without downtime.

Stretch goals

  • Add a liveness and readiness probe to at least one Deployment.
  • Use a PersistentVolumeClaim for the database tier's data directory so data survives a Pod restart.
  • Split your environment into two namespaces (e.g. staging and production) using the same YAML with different config.

Submit a link to your finished project (a repo with your YAML manifests, or a recording/write-up of it running) below, an instructor will review it before you can mark this lesson complete. Good luck! 🚀

This lesson ends in a project. Build it on your own machine, there's nowhere to submit it here, but the brief above is everything you need.