Skip to the page

Kubernetes in production · mid

Probes, manifests and NotReady nodes

Probes decide restarts and traffic, so wrong settings cause restart loops. A production manifest sets rollout strategy, probes, resources and security. Node failures need a clear order of checks.

The notes

What you must know

  • Liveness failing makes the kubelet restart the container. Readiness failing removes the pod from Service endpoints without a restart. A startup probe holds the other two off until it passes once.
  • A slow start (for example 60 seconds) against a short liveness budget kills the container before it is ever up. Fix with a startupProbe with a large failureThreshold.
  • Do not put dependencies such as the database in the liveness check. A slow database would then restart every pod at once. Use readiness for dependencies, and keep liveness for the process itself.
  • A Deployment has selector.matchLabels equal to the pod labels (the selector cannot change after creation), and strategy.rollingUpdate with maxUnavailable 0 and maxSurge 1 for no downtime.
  • A good container spec: image by tag or digest, ports, requests and limits, three probes, a securityContext (runAsNonRoot, allowPrivilegeEscalation false, read-only root filesystem, drop ALL), terminationGracePeriodSeconds, and a ClusterIP Service.
  • Add a PodDisruptionBudget and topology spread so maintenance and node failures do not remove all replicas.
  • NotReady means the kubelet stopped reporting. Check describe node conditions (MemoryPressure, DiskPressure, PIDPressure), then on the node systemctl status kubelet containerd, journalctl -u kubelet, dmesg -T, df and free.
  • PLEG is not healthy means the kubelet cannot get container states from the runtime in time. StatefulSet pods on a lost node do not move on their own, to avoid two writers; fix the node or follow the safe force-delete procedure.

The red pen

Common traps: mistake → fix

  • Mistake: Liveness should check the database

    Fix: that restarts every pod when the database is slow.

  • Mistake: Longer liveness timeout fixes slow start

    Fix: use a startup probe.

  • Mistake: StatefulSet pods reschedule at once when a node dies

    Fix: Kubernetes protects the volume from two writers.

Easy to hard

Questions interviewers ask, easy to hard

  1. Review these probes: pods restart in a loop during deploys.
  2. Write the manifests for a stateless API.
  3. Three nodes go NotReady at 3 am. What do you do?
  4. What do the three probes do?

Explain it out loud

Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.

Practise by voice

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview