Interview Q&A · questions with model answers
Kubernetes Interview Questions
Part of the study plan for: DevOps Engineer · Site Reliability Engineer (SRE) · Cloud Engineer
Ordered by how often they're asked. Most-asked answers are free to read in full; members see every answer and can rate their confidence on each.
-
Most asked Describe the Kubernetes architecture: what runs on the control plane and what runs on the nodes?
The control plane holds the cluster's desired state and makes decisions: the API server (the only component that talks to etcd), etcd (the key-value store), the scheduler (assigns pods to nodes) and…
-
Most asked What happens, step by step, when you run kubectl apply for a Deployment?
kubectl sends the manifest to the API server, which authenticates and authorises the request, runs admission controllers (mutating, then validating), validates the object and stores it in etcd. The…
-
Most asked Deployment, StatefulSet, DaemonSet, Job and CronJob: when do you use each?
Deployment for stateless, interchangeable replicas (web apps, APIs); StatefulSet for pods needing stable identity and their own storage (databases, Kafka, ZooKeeper); DaemonSet for one pod per node…
-
Most asked How do rolling updates work in a Deployment, and how do you roll back?
A rolling update creates a new ReplicaSet and shifts pods from old to new gradually, limited by maxSurge (extra pods allowed above the desired count) and maxUnavailable (pods allowed to be…
-
Most asked Explain the Service types: ClusterIP, NodePort, LoadBalancer, ExternalName and headless.
A Service gives a stable virtual IP and DNS name in front of a changing set of pods selected by labels. ClusterIP is reachable only inside the cluster; NodePort also opens a port on every node;…
-
Most asked How does the scheduler place pods? Explain resource requests, node affinity, taints and tolerations.
The scheduler filters nodes that can run the pod (enough unreserved CPU and memory for its requests, matching node selectors and affinity, tolerated taints, available volumes and ports) and then…
-
Most asked Liveness, readiness and startup probes: how do you configure them correctly?
Readiness decides whether a pod receives traffic; liveness decides whether the container is restarted; a startup probe holds off the other two until a slow-starting app is up. Readiness may reflect…
-
Most asked How does RBAC work in Kubernetes, and how do you apply least privilege?
Roles (namespaced) and ClusterRoles (cluster-wide) list allowed verbs on resources; RoleBindings and ClusterRoleBindings grant them to users, groups or ServiceAccounts. Everything is deny-by-default…
-
Most asked How do you secure workloads on Kubernetes? Explain Pod Security Standards and securityContext.
Run containers as non-root, drop Linux capabilities, disallow privilege escalation, use a read-only root filesystem and a seccomp profile, and enforce these with the Pod Security Standards…
-
Most asked How do persistent volumes work? Explain PV, PVC, StorageClass and CSI.
A PersistentVolumeClaim is a pod's request for storage (size, access mode); a PersistentVolume is the actual piece of storage; a StorageClass describes how to provision volumes dynamically, through…
-
How does pod networking work in Kubernetes, and what does the CNI plugin do?
Kubernetes requires that every pod gets its own IP and can reach every other pod without NAT. The CNI (Container Network Interface) plugin implements this: it assigns pod IPs, wires the pod's…
-
A Service is not reachable from another pod. How do you troubleshoot it?
Work along the path: does DNS resolve the Service name; does the Service have endpoints (selector matches pod labels and pods are ready); is the target port correct; can you reach a pod IP directly;…
-
How does DNS work in a Kubernetes cluster, and what is the ndots problem?
CoreDNS serves records such as my-svc.my-namespace.svc.cluster.local for Services (and per-pod records for headless Services). Pods get a resolv.conf with search domains and ndots:5, so any name…
-
How do container logs work in Kubernetes?
Containers write to stdout and stderr; the container runtime writes those streams to files on the node, the kubelet rotates them, and kubectl logs reads them. Logs disappear with the pod (and after…
-
How do topology spread constraints and anti-affinity improve availability?
They control where replicas land: topology spread constraints keep the number of replicas per zone or node within a maximum skew, and pod anti-affinity keeps replicas apart, so losing one node or…
-
How does kube-proxy work, and what are the alternatives?
kube-proxy runs on each node and programs packet rules so traffic to a Service's virtual IP is load-balanced to the ready pod IPs. Modes include iptables (long the default), IPVS, and nftables (the…
-
How do you run batch and scheduled workloads reliably on Kubernetes?
Use Jobs with sensible backoffLimit, activeDeadlineSeconds and ttlSecondsAfterFinished; CronJobs with concurrencyPolicy: Forbid (or Replace) and startingDeadlineSeconds; make tasks idempotent; and…
-
How do you handle configuration and secrets for different environments with Kubernetes?
Keep one image for all environments and inject environment-specific configuration at deploy time: Kustomize overlays or Helm values per environment, ConfigMaps for non-secret settings, and secrets…