Practice & Assessment
Test your understanding of Core Workload Resources: Pods, Deployments, and ReplicaSets
Multiple Choice Questions
5A Pod's readiness probe fails. What does Kubernetes do?
A container is consuming more memory than its limit. What happens?
You update a Deployment's image. Which existing object does Kubernetes create to manage the transition?
What does `maxUnavailable: 1` mean in a RollingUpdate strategy?
Which QoS class is assigned to a Pod where every container has identical resource requests and limits?
Coding Challenges
1Deploy, Update, and Roll Back a Web Application
Create a Deployment named 'frontend' with 3 replicas running nginx:1.24 in a namespace called 'web'. Add resource requests (100m CPU, 128Mi memory) and limits (200m CPU, 256Mi memory). Configure a liveness probe on path /healthz port 80. Apply the deployment and verify all 3 Pods are running. Then update the image to nginx:1.25 and watch the rollout. Finally, roll back to the previous revision and confirm the original image is restored. Expected output: `kubectl rollout history` shows 2 revisions; after rollback, `kubectl describe pod` shows nginx:1.24. Time estimate: 25 minutes.
Mini Project
Production-Grade Stateless API Deployment
Deploy a stateless API (use kennethreitz/httpbin as the image) to a namespace called 'api-prod'. The Deployment must have: 3 replicas, resource requests and limits, a liveness probe on /get port 80, a readiness probe on /status/200 port 80, labels for app, version, and environment. Write a script (bash or kubectl commands) that deploys version 1 (kennethreitz/httpbin:latest), verifies all pods are ready, simulates an update by changing an annotation, then rolls back. Include a README explaining every manifest field you set and why.
