Kubernetes Deployment with Probes & Limits
Take a container to a production-minimum Kubernetes deployment: a Deployment and Service, config and secrets, readiness and liveness probes, resource limits and autoscaling.
Anyone can kubectl run a pod; keeping it healthy under load is the job. Here we take an app from a bare Deployment to a production-minimum setup one manifest field at a time — a Service to reach it, ConfigMaps and Secrets for configuration, readiness and liveness probes so Kubernetes knows what "healthy" means, resource requests and limits, and a HorizontalPodAutoscaler. Each step adds one piece and names the incident it prevents.
What you'll build
- Run an app as a Deployment behind a Service
- Supply configuration with a ConfigMap and a Secret
- Add readiness and liveness probes
- Set resource requests and limits
- Scale automatically with an HPA
Contents
- A Deployment
- Declare the port
- A Service to reach it
- Non-secret config
- Inject the config
- Secrets, kept apart
- Inject the secret too
- Readiness: don't route too early
- Liveness: restart what's wedged
- Requests and limits
- Scale with load