# kubernetes
// [58] real interview questions. Answers and sources live in the practice app.
practice this topic- You deploy a pod and it goes into CrashLoopBackOff. What does that status mean and how do you debug it?(mid)
- A pod you created is stuck in Pending state. What are the possible reasons and how do you find the actual one?(mid)
- A pod shows the status ErrImagePull (or ImagePullBackOff). What does it mean and how do you resolve it?(junior)
- When would you NOT use Kubernetes? Give concrete cases where adopting it is the wrong call.(senior)
- Walk through what happens, component by component, from the moment you run `kubectl run` (or apply a Pod manifest) until the container is running.(mid)
- A container in your cluster keeps getting OOMKilled. What is happening and how do you prevent memory issues like this cluster-wide?(mid)
- What QoS classes does Kubernetes assign to pods, and why do they matter when a node comes under memory pressure?(senior)
- Explain liveness and readiness probes. What can go wrong if you configure a liveness probe badly?(mid)
- How does a failing readiness probe affect a Service that selects the pod?(mid)
- What exactly happens when you delete a pod? Why does graceful termination matter for zero-downtime deploys?(mid)
- Differentiate between Deployments, StatefulSets, and DaemonSets. When do you pick each?(mid)
- You start a rolling update and halfway through the new pods are failing. What does Kubernetes do, and what do you do? What would you configure beforehand to make this safe?(senior)
- What Service types exist in Kubernetes and when do you use each?(junior)
- How does a Service actually route traffic to pods? Explain the roles of labels, Endpoints, and kube-proxy.(mid)
- An application behind a Service suddenly became unreachable. Walk through how you troubleshoot it end to end.(senior)
- What is an Ingress, what is an Ingress Controller, and why do you need both?(mid)
- How does DNS-based service discovery work inside a Kubernetes cluster?(mid)
- By default, can any pod talk to any other pod in the cluster? How do NetworkPolicies change that, and what's a common gotcha?(mid)
- Multiple teams share one cluster. How do you keep them from stepping on each other and from consuming all cluster resources?(mid)
- What happens to running pods if the kubelet stops on a worker node?(senior)
- Why does Kubernetes use etcd instead of a SQL or document database? What guarantees does it rely on?(senior)
- Are Kubernetes Secrets actually secure by default? How do you handle secrets properly, including in Git?(senior)
- Explain RBAC in Kubernetes: Role vs ClusterRole, RoleBinding, and what ServiceAccounts are for.(mid)
- A ReplicaSet maintains 3 replicas. What happens if you delete one of its pods directly with `kubectl delete pod`? And if you remove the matched label from a pod?(junior)
- If ReplicaSets already keep the right number of pods running, why do you use a Deployment instead of creating ReplicaSets directly?(junior)
- Explain PersistentVolume, PersistentVolumeClaim, and StorageClass. How does dynamic provisioning work?(mid)
- When is it legitimate to run multiple containers in one pod, and why is one container per pod still the norm?(junior)
- A CronJob runs every minute with concurrencyPolicy: Allow and sometimes its jobs hang or fail. What goes wrong over time and how do you fix it?(senior)
- How does the Horizontal Pod Autoscaler work, and what must be true for it to function?(mid)
- You manage several Kubernetes clusters. How do you switch between them with kubectl, and where is that configuration stored?(junior)
- ConfigMap vs Secret: what's the difference and how do you get their values into a running container?(mid)
- What is a Kubernetes Operator, and when do you need one instead of a plain Deployment plus Helm chart?(senior)
- You suspect a pod is having issues but have no specifics. Describe your generic first-five-minutes debugging workflow.(mid)
- What is a pod, and why is it the smallest deployable unit in Kubernetes rather than the container?(junior)
- You add a taint to a node to keep general workloads off it, but a critical DaemonSet pod stops getting scheduled there too. What happened, and how do you fix it while keeping the taint?(senior)
- Contrast nodeSelector, node affinity, and pod (anti-)affinity. When would you reach for `preferred` over `required` scheduling rules?(senior)
- You need to patch the OS on a worker node without disrupting the apps on it. Walk through the drain/cordon workflow and the failure mode a PodDisruptionBudget prevents.(senior)
- Explain how a validating vs mutating admission webhook fits into request handling, and the operational risk of a webhook that's down.(senior)
- Your app must not start until a database migration has run and a config file exists. How do you guarantee that ordering in a pod, and how is it different from a sidecar?(mid)
- What is a headless Service, and why do StatefulSets require one?(mid)
- A node's disk fills up and pods on it start getting evicted, some with status 'Evicted' piling up. What's the mechanism, and how do you prevent it recurring?(senior)
- What are static pods, how do they differ from normal pods, and where do you actually find the control-plane's own static pods?(mid)
- Labels vs annotations: they're both key-value metadata on objects, so when do you use which, and what breaks if you confuse them?(mid)
- Helm gives you templating and releases — but where does it fall short, and what do you actually gain over `kubectl apply -f`?(mid)
- Your cluster is on version 1.28 and you need to upgrade. In what order do you upgrade components, and why can't you skip minor versions?(senior)
- How would you run a blue-green or canary release in Kubernetes using native primitives, and what's the honest limitation of doing it with plain Deployments?(senior)
- etcd on your cluster gets corrupted or you lose quorum. What's the blast radius, and how do you recover?(senior)
- HPA scales pods; who scales the nodes? Explain Cluster Autoscaler and one way it interacts badly with the HPA.(senior)
- Can you run HPA and VPA on the same workload? What's the conflict, and when do you use VPA?(senior)
- A pod is misbehaving but its image is distroless — no shell, no debugging tools. How do you inspect it live without rebuilding the image?(senior)
- What is a securityContext, and which settings would you set to harden a pod that shouldn't need root?(senior)
- You try to delete a namespace and it hangs in Terminating for a long time. What's usually causing this, and how do you resolve it safely?(senior)
- kube-proxy can run in iptables or IPVS mode. Why does the choice matter at scale, and what's replacing kube-proxy entirely?(senior)
- You set a memory request of 128Mi and a limit of 512Mi on every pod to be safe. What's the downside of that gap, and how does the request affect scheduling vs the limit?(mid)
- A pod's ServiceAccount token is broader than it needs to be. Describe a realistic privilege-escalation path in a cluster and the RBAC settings that shut it down (defensive).(senior)
- A Job you run for a batch task keeps creating new pods after failures and never stops. How do Jobs handle retries, and which fields control completion and failure?(mid)
- Explain PriorityClass and preemption. What surprising outage can misusing pod priority cause?(senior)
- After deploying a default-deny NetworkPolicy in a namespace, pods can no longer resolve DNS and all outbound calls fail. What did you forget?(mid)