Skip to content
Ameen Abozaid
MID-057

Kubernetes foundations

  • 10 Lessons
  • 4 h practice (estimate)
On this page 8 topics

Overview

Topics

  • Pods
  • Deployments
  • Services
  • ConfigMaps
  • Secrets
  • probes
  • autoscaling

Learn first

4 h of practice (estimate)

Learning outcomes

  1. Explain the control plane, nodes, and the desired-state model.
  2. Deploy services with Deployments, Services, ConfigMaps, and Secrets.
  3. Configure liveness, readiness, and startup probes plus resource requests and limits for JVM services.
  4. Scale with the Horizontal Pod Autoscaler and perform rolling updates.
  5. Debug pods (describe, logs, exec, events).

Lessons

  1. 01Why Kubernetes
  2. 02Architecture and desired state
  3. 03Pods and Deployments
  4. 04Services and Ingress
  5. 05ConfigMaps and Secrets
  6. 06Probes for JVM services
  7. 07Requests, limits, and autoscaling
  8. 08Debugging pods
  9. 09Demo: deploying Shop Platform to a cluster
  10. 10Demo: a crash-looping pod, diagnosed

Lab and exercises

Lab

MID-057-LAB1 · Shop on Kubernetes

Outcomes: 1–5 · Time: ~4 h Deploy all Shop services, Kafka (operator or managed), and the gateway to a cluster (kind, k3d, or managed). Use Deployments, Services, an Ingress, ConfigMaps, and Secrets. Configure startup, readiness, and liveness probes and resource requests and limits for each JVM service, and an HPA on orders. Acceptance: a rolling update under load with zero failed requests.

Exercises (assessment: debugging a broken manifest set)

IDOutcomeTask
MID-057-EX011Explain what happens between kubectl apply and a running pod.
MID-057-EX022Write the Deployment, Service, and ConfigMap for inventory.
MID-057-EX033Fix this probe set: liveness calls an endpoint that queries the database; no startup probe.
MID-057-EX043Set requests, limits, and JVM heap flags for a service using about 600 MB of heap.
MID-057-EX054Add an HPA to orders and a rolling update strategy with no lost capacity.
MID-057-EX065Debug the provided manifests: ImagePullBackOff, a wrong Service selector, and an OOMKilled pod.
Show solutions
  • EX01 API server stores the object in etcd; a controller creates a ReplicaSet and pods; the scheduler assigns a node; the kubelet pulls the image and starts containers.
  • EX02 Deployment with a pinned image and labels; Service selecting app: inventory; ConfigMap via envFrom.
  • EX03 Liveness checks only that the process is alive (/actuator/health/liveness); readiness may reflect dependencies; add a startup probe with a generous failure threshold.
  • EX04 Example: memory request and limit 1 Gi, -XX:MaxRAMPercentage=70, CPU request 500m; verify by observing the pod under load.
  • EX05 HorizontalPodAutoscaler minReplicas 3, maxReplicas 10, CPU 70%; maxSurge: 1, maxUnavailable: 0.
  • EX06 describe shows the wrong tag or registry credentials; compare Service selector with pod labels (kubectl get endpoints is empty); OOMKilled: raise the limit or reduce heap after checking usage.

Outcome 1 is also covered by quiz Q01–Q02; the other outcomes by the lab and the debugging exercise.

Quiz

Outcomes: O1 architecture and desired state · O2 core objects · O3 probes and resources · O4 scaling and rolling updates · O5 debugging.

A self-check for you: nothing is graded, saved or sent anywhere. Choose an answer, then check it. You can try again as often as you like.

  1. 1Kubernetes stores cluster state in:O1
  2. 2Controllers work by:O1
  3. 3A Deployment provides:O2
  4. 4Why call a Service by name?O2
  5. 5A Kubernetes Secret by default is:O2
  6. 6A liveness probe should:O3
  7. 7A startup probe helps JVM services by:O3
  8. 8A pod exceeding its memory limit is:O3
  9. 9The HPA changes:O4
  10. 10To see logs of the container that just crashed:O5

Practical part

Debugging exercise (MID-057-EX06) plus lab MID-057-LAB1. Pass: quiz at least 8/10, all Shop services running with probes, limits, and HPA, and a rolling update under load with zero failed requests.

Common mistakes

Liveness probes that check the database; no memory limits for JVMs; latest tags.

Assessment

Debugging exercise on a broken manifest set.

Career relevance

Platform engineering (SRB-010) and the MID capstone.

Type to search levels, phases, modules and lessons.