Kubernetes Engineer interview questions
100 real questions with model answers and explanations for Middle candidates.
See a Kubernetes Engineer resume example →Practice with flashcards
Spaced repetition · Hunter Pass
Questions
A controller continuously compares observed cluster state with the declared desired state and acts to reduce the difference.
- Users submit intent through API objects rather than issuing a fixed sequence of commands to nodes.
- Controllers watch resources and use labels, selectors, and owner references to manage dependent objects.
- Reconciliation is repeated and must be idempotent because events can be duplicated or state can change between observations.
- Status records observed results, while spec remains the requested state that the controller works toward.
Why interviewers ask this: The interviewer checks whether the candidate understands Kubernetes as convergent control loops rather than imperative orchestration.
A Deployment manages stateless replicated Pods through ReplicaSets and provides declarative rollout and rollback behavior.
- Its selector identifies the Pods it owns, while the Pod template defines the desired revision.
- Changing the template creates a new ReplicaSet and shifts replicas according to the update strategy.
- The controller replaces failed or deleted Pods to maintain the declared replica count.
- Pod names and identities are disposable, so durable identity or storage should not depend on a particular replica.
Why interviewers ask this: A strong answer connects Deployment behavior to ReplicaSets, revisions, and stateless Pod identity.
maxSurge limits extra Pods above the desired replica count, while maxUnavailable limits how many desired replicas may be unavailable during rollout.
- Higher surge can speed replacement but requires spare cluster capacity.
- Lower unavailability protects serving capacity but can slow progress when new Pods start gradually.
- Both accept absolute numbers or percentages, with rounding behavior applied by the Deployment controller.
- Readiness determines whether a new Pod counts as available, so rollout safety depends on a meaningful readiness probe.
Why interviewers ask this: The interviewer evaluates whether the candidate can relate rollout parameters to capacity and availability.
StatefulSet is appropriate when replicas need stable identity, ordered lifecycle, or individually associated persistent storage.
- Pods receive predictable ordinal names and stable network identities across rescheduling.
- volumeClaimTemplates create a distinct PVC for each ordinal rather than one disposable shared volume.
- OrderedReady behavior controls default creation, scaling, and update order, while Parallel pod management relaxes some ordering.
- StatefulSet does not make an application distributed or replicate its data; the workload must still implement those semantics.
Why interviewers ask this: A strong answer selects StatefulSet for concrete identity and storage requirements without treating it as automatic database clustering.
A headless Service provides stable DNS records for individual StatefulSet Pods without placing a virtual Service IP in front of them.
- Setting clusterIP to None lets DNS return Pod addresses rather than one load-balanced address.
- Each ordinal can receive a predictable name such as pod-0.service.namespace.svc.
- Peer-aware systems can use those records for discovery, membership, or leader coordination.
- Readiness and publishNotReadyAddresses must be chosen deliberately when peers need discovery before becoming ready.
Why interviewers ask this: The interviewer checks whether the candidate understands stable per-Pod discovery and its readiness trade-off.
A DaemonSet runs a Pod on every eligible node or on every node matching its scheduling constraints.
- Typical uses include log collectors, node monitoring agents, CNI components, and storage node plugins.
- New eligible nodes receive the Pod automatically, and Pods disappear when their nodes leave the cluster.
- Node selectors, affinity, and taints determine which classes of nodes actually run the daemon.
- Application replicas that scale with traffic usually belong in a Deployment rather than a DaemonSet.
Why interviewers ask this: A strong answer connects DaemonSet to node-local responsibility and scheduling eligibility.
A Job creates Pods until it reaches the required number of successful completions or its failure policy stops further attempts.
- completions defines the required successes, while parallelism limits concurrently running Pods.
- backoffLimit bounds retries, and activeDeadlineSeconds bounds total execution time.
- restartPolicy must be Never or OnFailure because successful Job Pods should not restart forever.
- Indexed Jobs give parallel workers stable completion indexes when input can be partitioned deterministically.
Why interviewers ask this: The interviewer evaluates whether the candidate can express completion, parallelism, and bounded failure for batch work.
A CronJob creates Jobs on a schedule and needs explicit rules for missed runs, overlap, time zones, and history.
- concurrencyPolicy decides whether overlapping runs are allowed, skipped, or replaced.
- startingDeadlineSeconds limits how late a missed schedule may still create a Job.
- The timeZone field makes schedule interpretation explicit instead of relying on controller defaults.
- Successful and failed history limits prevent old Job objects from accumulating without bounds.
Why interviewers ask this: A strong answer goes beyond cron syntax and covers overlap, missed schedules, and object retention.
OnFailure can restart a failed container inside the same Pod, while Never leaves the Pod terminal and lets the Job create another one.
- Pod-level restarts preserve Pod identity but make attempts less visible as separate objects.
- Never represents each failed attempt as a separate Pod, which simplifies inspection at the cost of more objects.
- backoffLimit still governs Job retries, while per-index policies can refine indexed workloads.
- The task must tolerate retries because Kubernetes cannot guarantee that a failed attempt produced no external side effect.
Why interviewers ask this: The interviewer checks whether the candidate distinguishes container restart from Job replacement and understands retry semantics.
A controller's selector defines ownership of matching Pods, so it must align with template labels and avoid overlap with other controllers.
- A selector that does not match the Pod template is rejected for controllers such as Deployment.
- Overlapping selectors can make controllers compete over similar Pods and produce unsafe ownership assumptions.
- Deployment selectors are immutable in the stable API, so changing identity usually requires a new Deployment.
- Labels used only for release or observability should be separated from the stable labels that define controller identity.
Why interviewers ask this: A strong answer treats selectors as durable ownership boundaries rather than arbitrary query labels.
The Service type determines how a stable virtual endpoint is exposed beyond its selected Pods.
- ClusterIP is reachable inside the cluster and is the default for internal service discovery.
- NodePort opens the same port on eligible nodes and forwards traffic to the Service, often as a building block rather than a final public interface.
- LoadBalancer asks a supported cloud or implementation controller to provision an external load balancer, usually backed by Service networking.
- All three still depend on selectors or explicit EndpointSlices that identify ready backends.
Why interviewers ask this: The interviewer evaluates whether the candidate understands exposure layers without confusing a Service with an application proxy.
Ingress declares HTTP routing intent, while an Ingress Controller watches that intent and configures a concrete proxy or load balancer.
- Creating an Ingress without a matching controller produces no data-plane implementation.
- ingressClassName selects the controller class when a cluster hosts more than one implementation.
- Host and path rules route requests to Kubernetes Services, not directly to arbitrary Pods.
- Controller-specific annotations add features but reduce portability beyond the standard Ingress API.
Why interviewers ask this: A strong answer separates declarative API objects from the controller that realizes them.
Ingress matches request hosts and paths to Service backends, and its TLS section associates hosts with certificate Secrets.
- Exact matches one path precisely, while Prefix matches path segments according to Kubernetes path rules.
- ImplementationSpecific delegates matching behavior to the selected controller and is less portable.
- A TLS Secret normally contains tls.crt and tls.key in the same namespace as the Ingress.
- Termination at the controller protects the client connection, while backend encryption requires separate controller and service configuration.
Why interviewers ask this: The interviewer checks whether the candidate can reason about portable routing and both sides of TLS termination.
Gateway API separates infrastructure attachment from application routes and provides richer typed routing resources.
- GatewayClass identifies an implementation, Gateway defines listeners, and HTTPRoute or other routes attach traffic rules.
- allowedRoutes controls which namespaces may attach Routes to a Gateway, while ReferenceGrant authorizes cross-namespace object references such as backends.
- Status conditions make route acceptance and attachment visible in a standardized way.
- Ingress remains valid for simpler HTTP routing, while Gateway API fits shared and multi-team traffic infrastructure more cleanly.
Why interviewers ask this: A strong answer understands Gateway API's role separation and typed extensibility rather than calling it only a newer Ingress.
A default-deny policy selects Pods and isolates them so only traffic allowed by other applicable policies is accepted.
- Ingress and egress isolation are independent and must be declared for the directions that need denial.
- An empty ingress or egress rule list allows no traffic in that direction for selected Pods.
- Policies are additive, so a later policy adds allowed traffic rather than overriding the default-deny object.
- Enforcement requires a network plugin that implements NetworkPolicy semantics.
Why interviewers ask this: The interviewer evaluates whether the candidate understands isolation direction, additive rules, and CNI enforcement.
Selectors in the same peer entry are ANDed, while separate peer entries represent alternative allowed sources or destinations.
- podSelector alone selects matching Pods in the policy's namespace.
- namespaceSelector alone selects all qualifying Pods in matching namespaces.
- Combining both in one entry selects matching Pods only inside matching namespaces.
- YAML list indentation matters because splitting them into two entries broadens access instead of narrowing it.
Why interviewers ask this: A strong answer can predict selector scope and avoids a common policy-broadening mistake.
Egress isolation normally needs an explicit allowance for Pods to reach the cluster DNS service before name-based application traffic can work.
- A policy can select the DNS Pods and permit UDP and TCP on the configured DNS port.
- The actual namespace and labels depend on the cluster DNS deployment and should not be guessed from examples.
- Standard NetworkPolicy controls IP and port traffic, not arbitrary DNS names after resolution.
- DNS access alone does not permit the resolved destination, which still needs its own egress rule.
Why interviewers ask this: The interviewer checks whether the candidate distinguishes name resolution from authorization to the resolved endpoint.
Standard NetworkPolicy provides namespaced L3 and L4 allow rules but does not define every network-security feature.
- It has no native deny-rule priority because applicable allow policies are additive.
- HTTP paths, methods, and other L7 attributes require CNI-specific policy or another proxy layer.
- Policy behavior for host networking and some node traffic depends on the network implementation.
- Products such as Cilium extend the model, but those resources are not portable Kubernetes NetworkPolicy.
Why interviewers ask this: A strong answer knows when the portable API ends and implementation-specific capabilities begin.
Ephemeral storage follows the Pod or container lifecycle, while persistent storage is represented independently so data can survive Pod replacement.
- emptyDir is created for a Pod and removed when that Pod leaves its node permanently.
- A PVC references durable storage whose lifecycle is controlled by claims, volumes, and reclaim policy rather than one container restart.
- ConfigMap, Secret, and projected volumes provide configuration data, not general durable application storage.
- Choosing a volume starts from durability, sharing, access mode, and storage-provider requirements.
Why interviewers ask this: The interviewer evaluates whether the candidate matches storage lifetime and semantics to the workload.
A PVC requests storage properties, and Kubernetes binds it to one compatible PV or dynamically provisions a matching volume.
- Compatibility includes requested capacity, access modes, storageClassName, and selector constraints.
- Binding is one-to-one even when the underlying storage can support access from several Pods.
- The PVC is namespaced, while the PV is a cluster-scoped representation of storage.
- A Pod references the PVC, not the provider-specific PV details, which separates workload intent from infrastructure.
Why interviewers ask this: A strong answer explains matching, scope, and the abstraction boundary between claim and volume.
Locked questions
- 21
What role does StorageClass play in dynamic provisioning?
storage - 22
How do access modes and reclaim policies affect persistent storage design?
design - 23
What responsibilities does the CSI architecture separate?
architecture - 24
How do volumeClaimTemplates behave when a StatefulSet scales or is deleted?
workloads - 25
How do CPU and memory requests influence Pod scheduling?
jobsworkloadsmemory - 26
How do CPU and memory limits behave differently?
memory - 27
How are Kubernetes QoS classes assigned and used?
kubernetes - 28
What problem does LimitRange solve inside a namespace?
namespaceskubernetes - 29
How should liveness and readiness probes divide responsibility?
health-checks - 30
When is a startup probe needed?
health-checks - 31
How do HTTP, TCP, exec, and gRPC probes differ?
networkinghealth-checkshttp - 32
How does a ServiceAccount give a Pod an API identity?
workloadsapi - 33
How do Role and ClusterRole differ in RBAC?
rbaccluster - 34
How do RoleBinding and ClusterRoleBinding change permission scope?
cluster - 35
What does least-privilege RBAC require in practice?
rbac - 36
What isolation do namespaces provide and what do they not provide?
namespaceskubernetes - 37
How does ResourceQuota govern a namespace?
namespaceskubernetes - 38
When is nodeSelector sufficient for scheduling placement?
jobs - 39
How does node affinity extend nodeSelector?
scheduling - 40
When should pod affinity or anti-affinity be used?
workloadsscheduling - 41
How do topology spread constraints differ from pod anti-affinity?
workloadsschedulingspread - 42
How do taints and tolerations affect scheduling?
jobsscheduling - 43
How do PriorityClass and preemption influence scheduling?
jobs - 44
What belongs in a basic Helm chart?
helm - 45
How should Helm values and templates be designed?
helmdesign - 46
How do Helm install, upgrade, and rollback manage a release?
rollbackhelm - 47
How does HPA calculate a desired replica count?
replication - 48
Why do CPU requests matter for an HPA CPU utilization target?
- 49
How do HPA behavior settings and multiple metrics affect scaling?
scalingmonitoring - 50
When would KEDA complement or replace a conventional HPA configuration?
config - 51
How would you deploy a new stateless service to a production Kubernetes cluster safely?
kubernetesclusterdeployment - 52
A newly deployed pod is in CrashLoopBackOff; how do you investigate it?
workloadstroubleshootingdeployment - 53
Services across several namespaces have intermittent timeouts after a Cilium change; how do you debug them?
resiliencenamespaceskubernetes - 54
Pods can resolve external domains but not an internal Service name; how do you debug CoreDNS and service discovery?
- 55
A Deployment has pods stuck in Pending even though the cluster appears to have free capacity; what do you inspect?
capacityworkloadscluster - 56
Several pods were Evicted during a traffic spike; how do you find and fix the cause?
- 57
A production rollout is blocked by ImagePullBackOff on only some nodes; how do you troubleshoot it?
- 58
An Ingress starts returning 502 responses after a release while pods report Ready; how do you investigate?
networkingkubernetes - 59
Clients report TLS certificate errors for one hostname behind the ingress controller; what do you check?
tlskubernetesnetworking - 60
How would you migrate an existing Ingress route to Gateway API without risking all traffic?
gatewaynetworkingapi - 61
An application receives a forbidden error when listing ConfigMaps; how do you debug RBAC?
rbacconfigkubernetes - 62
You discover that a namespace application uses cluster-admin; how do you reduce its permissions safely?
namespacesclusterkubernetes - 63
CPU is saturated but an HPA does not add replicas; how do you diagnose it?
replication - 64
A queue backlog grows rapidly but KEDA keeps the consumer at one replica; what do you inspect?
backlogreplicationdata-structures - 65
How would you apply VPA recommendations to a latency-sensitive service without causing an outage?
latency - 66
A rolling update is stuck with old and new pods both present; how do you resolve it?
deployment-strategiesproblem-solving - 67
A release managed by Argo CD increases errors; how do you roll it back without creating more drift?
iacgitops - 68
A pod is Pending because its PersistentVolumeClaim is unbound; how do you debug it?
workloads - 69
A StatefulSet pod cannot start after moving nodes because the volume reports a multi-attach error; what do you do?
workloads - 70
A container is repeatedly OOMKilled even though the node has free memory; how do you fix it?
containersmemory - 71
A service has high latency and CPU throttling while average CPU usage looks modest; how do you investigate?
latency - 72
How would you tune requests and limits for a service that wastes capacity but must survive traffic peaks?
capacity - 73
Karpenter sees Pending pods but does not provision a node; how do you debug the decision?
autoscaling - 74
Karpenter consolidation is saving money but causing repeated workload disruptions; how do you adjust it?
autoscaling - 75
An Argo CD ApplicationSet deploys successfully to most clusters but fails in two; how do you investigate?
deploymentgitopscluster - 76
Argo CD reports an application as OutOfSync after an emergency manual fix; how do you reconcile it safely?
gitops - 77
The Gatekeeper admission webhook is timing out and blocking every deployment; how do you restore service safely?
workloadswebhooksdeployment - 78
How would you introduce a new Gatekeeper constraint that existing workloads currently violate?
- 79
How would you move a namespace to the Restricted Pod Security Admission profile without breaking its workloads?
workloadsnamespaceskubernetes - 80
After a service mesh rollout, one service sees higher latency and intermittent 503 responses; how do you debug it?
service-meshlatency - 81
Mutual TLS traffic in the service mesh starts failing near a certificate rotation; what do you inspect?
service-meshtls - 82
Users report slow requests but pod health and CPU dashboards look normal; how do you use Prometheus, Loki, and Tempo to investigate?
monitoringloggingworkloads - 83
A kube-prometheus alert says API errors are high, but the service team sees no incident; how do you validate the alert?
alertingmonitoringapi - 84
How would you prove that a Velero backup can restore a namespace after accidental deletion?
backupsnamespaceskubernetes - 85
A Velero restore recreates resources but the application data is inconsistent; how do you improve the backup design?
designbackups - 86
A Cluster API Machine remains in Provisioning and never joins the workload cluster; how do you debug it?
joinsapicluster - 87
How would you upgrade a workload cluster managed by Cluster API while maintaining service availability?
clusterapi - 88
Pods on one node lose network connectivity while the node remains Ready; how do you debug the CNI path?
networking - 89
A new NetworkPolicy blocks an application from reaching its database; how do you find the missing rule?
database - 90
A ClusterIP Service works from pods on the same node but fails across nodes in a Cilium cluster; what do you inspect?
cluster - 91
DNS latency rises under load and causes application timeouts; how do you stabilize CoreDNS?
dnsresiliencelatency - 92
A node drain is blocked by PodDisruptionBudgets during maintenance; how do you proceed?
- 93
Topology spread constraints leave replicas Pending during a zone capacity shortage; how do you balance availability and scheduling?
capacityjobsreplication - 94
A pod stays in Init because a migration init container never completes; how do you debug and recover it?
containersmigrationsworkloads - 95
A pod remains Terminating for a long time during a rollout; what do you investigate before forcing deletion?
workloads - 96
A ConfigMap or Secret changed, but running pods still use old values; how do you roll out the update reliably?
configurationconfigkubernetes - 97
A workload has both a hand-written HPA and a KEDA ScaledObject, and replica counts oscillate; how do you fix it?
replication - 98
Traffic doubles suddenly, but adding pod replicas does not restore latency; how do you debug and scale the whole path?
replicationlatencyworkloads - 99
An HTTPRoute exists but traffic still goes to the old backend; how do you debug Gateway API attachment and precedence?
gatewayapi - 100
After deploying a high-traffic service change, how do you decide whether to continue, pause, or roll back?
deploymentrollback