Kubernetes in one page

Pods, deployments, services and scaling: the Kubernetes words interviewers expect you to know.

Kubernetes in one page

Kubernetes (K8s) runs containers on a group of machines (a cluster) and keeps them in the state you describe.

The main objects

  • Pod: the smallest unit. One or more containers that run together and share a network address.
  • Deployment: “keep 3 copies of this pod running, with this image.” Change the image and it rolls out new pods step by step.
  • Service: one stable name and address in front of a changing group of pods, with load balancing between them.
  • Ingress: routes outside HTTP traffic (like api.example.com/orders) to services.
  • ConfigMap and Secret: configuration and passwords given to pods without rebuilding the image. A Secret is only base64-encoded by default, not encrypted, so limit who can read it.

What it does for you

  • Self-healing: restarts containers that crash, replaces unhealthy ones, and only sends traffic to pods that pass their readiness check.
  • Scaling: change the number of copies, or let a Horizontal Pod Autoscaler add pods when CPU goes up.
  • Rolling updates: new versions go out gradually and can be rolled back.

You describe, it makes it true

You write the desired state in YAML (for example, 3 replicas). Kubernetes keeps comparing what runs with what you asked for, and fixes any difference.

Interview tips

  • Know the difference between a Pod (instance), a Deployment (keeps copies running) and a Service (stable address).
  • Health checks matter: a liveness probe restarts a stuck container; a readiness probe keeps traffic away until it is ready.

Read more: https://roadmap.sh/kubernetes

#tip · TIP-062


Write a comment