It handles scheduling containers onto nodes, self-healing (restarting and rescheduling failed containers), service discovery and load balancing, rolling updates and rollbacks, autoscaling, configuration and secret management, and storage orchestration.
Key takeaways
- 50 Kubernetes interview questions, grouped by level: freshers, intermediate, experienced and coding.
- Every answer starts with a one-line “Quick answer” you can say out loud, followed by the explanation and runnable code.
- Use the filter bar to practise only the level you are interviewing for, then test yourself with the free Kubernetes quiz.
What is Kubernetes, and why do interviewers ask about it?
Kubernetes (K8s) is the open-source platform for running containers at scale. It schedules containers across a cluster of machines, keeps the declared number of replicas running, rolls out new versions without downtime, and gives services stable networking and storage.
Kubernetes interviews for DevOps, SRE, platform and backend engineers move from core objects (Pods, Deployments, Services) to how the control plane works, networking, configuration, autoscaling, security (RBAC, network policies) and — most importantly — troubleshooting broken workloads.
Why companies hire for Kubernetes
- Kubernetes is the standard platform for cloud-native applications
- Every major cloud offers managed Kubernetes (EKS, GKE, AKS)
- DevOps, SRE and platform roles almost always require K8s
- Debugging skills (CrashLoopBackOff, Pending pods) separate strong candidates
Basic Kubernetes Interview Questions for Freshers
12 questionsStart here if you are a fresher or switching to Kubernetes. These fundamentals are asked in almost every first-round and campus interview.
How interviewers ask it“Explain the Kubernetes architecture, ideally with an example from a project you've worked on.”
Explain the Kubernetes architecture.
- kube-apiserver: the front door — every component and
kubectltalk to it - etcd: a consistent key-value store holding all cluster state
- kube-scheduler: assigns new Pods to nodes based on resources and constraints
- kube-controller-manager: runs controllers (Deployment, ReplicaSet, Node…) that reconcile actual state with desired state
- cloud-controller-manager: integrates with cloud load balancers, routes and volumes
Worker nodes:
- kubelet: the node agent that ensures the Pods' containers are running
- container runtime: containerd or CRI-O
- kube-proxy (or an eBPF data plane such as Cilium): implements Service networking
How interviewers ask it“Let's start with the basics — how would you explain a Pod in Kubernetes?”
What is a Pod?
apiVersion: v1
kind: Pod
metadata:
name: web
labels: { app: web }
spec:
containers:
- name: nginx
image: nginx:1.27
ports: [{ containerPort: 80 }]How interviewers ask it“Let's start with the basics — how would you explain a Deployment in Kubernetes?”
What is a Deployment?
apiVersion: apps/v1
kind: Deployment
metadata: { name: api }
spec:
replicas: 3
selector: { matchLabels: { app: api } }
strategy:
rollingUpdate: { maxSurge: 1, maxUnavailable: 0 }
template:
metadata: { labels: { app: api } }
spec:
containers:
- name: api
image: ghcr.io/acme/api:1.4.2
ports: [{ containerPort: 8080 }]| Type | Reachable from | Use |
|---|---|---|
| ClusterIP (default) | Inside the cluster | Service-to-service traffic |
| NodePort | <NodeIP>:<30000–32767> | Simple external access, testing |
| LoadBalancer | A cloud load balancer IP | Exposing a service externally on a cloud |
| ExternalName | A DNS CNAME alias | Pointing to an external service |
Headless (clusterIP: None) | Direct Pod IPs through DNS | StatefulSets, client-side load balancing |
How interviewers ask it“Let's start with the basics — how would you explain a Namespace in Kubernetes?”
What is a Namespace?
kubectl create namespace payments
kubectl get pods -n paymentsHow interviewers ask it“Let's start with the basics — how would you explain labels and selectors in Kubernetes?”
What are labels and selectors?
kubectl get pods -o wide # list pods with node and IP
kubectl describe pod api-7d9f # events, state, probes
kubectl logs api-7d9f -c api --previous # logs from the previous crashed container
kubectl exec -it api-7d9f -- sh # shell into a container
kubectl apply -f deploy.yaml # declarative create/update
kubectl rollout status deploy/api # watch a rollout
kubectl rollout undo deploy/api # roll back
kubectl port-forward svc/api 8080:80 # local access for debugging
kubectl top pods # CPU/memory (needs metrics-server)How interviewers ask it“In simple words, what are ConfigMaps and Secrets? Explain it like you would to a new teammate.”
What are ConfigMaps and Secrets?
Secrets are only base64-encoded by default, not encrypted. Enable encryption at rest in etcd, restrict access with RBAC, and consider external secret managers (Vault, AWS Secrets Manager with External Secrets Operator).
envFrom:
- configMapRef: { name: api-config }
env:
- name: DB_PASSWORD
valueFrom: { secretKeyRef: { name: db-secret, key: password } }How interviewers ask it“Can you compare imperative and declarative management? Where do people usually confuse them?”
What is the difference between imperative and declarative management?
How interviewers ask it“In simple words, what is a DaemonSet? Explain it like you would to a new teammate.”
What is a DaemonSet?
Intermediate Kubernetes Interview Questions
21 questionsQuestions for candidates with 1–3 years of experience — the concepts interviewers use to check that you have actually built things with Kubernetes.
| Deployment | StatefulSet | |
|---|---|---|
| Pod names | Random (api-7d9f-x2) | Stable, ordered (db-0, db-1) |
| Storage | Usually shared or none | One PersistentVolumeClaim per Pod via volumeClaimTemplates |
| Startup and scaling | Parallel | Ordered (by default) |
| Network identity | Through the Service | A stable DNS name per Pod via a headless Service |
How interviewers ask it“Explain Jobs and CronJobs in Kubernetes in detail — what should a new team member understand about them?”
What are Jobs and CronJobs?
apiVersion: batch/v1
kind: CronJob
metadata: { name: nightly-report }
spec:
schedule: "30 1 * * *"
concurrencyPolicy: Forbid
jobTemplate:
spec:
backoffLimit: 3
template:
spec:
restartPolicy: OnFailure
containers:
- name: report
image: ghcr.io/acme/report:2.1- Readiness probe: "can this Pod receive traffic?" If it fails, the Pod is removed from Service endpoints but not restarted
- Liveness probe: "is this container stuck?" If it fails, the kubelet restarts the container
- Startup probe: "has the app finished starting?" It disables the other probes until it passes — for slow-starting apps
readinessProbe:
httpGet: { path: /ready, port: 8080 }
periodSeconds: 5
livenessProbe:
httpGet: { path: /healthz, port: 8080 }
initialDelaySeconds: 10
failureThreshold: 3
startupProbe:
httpGet: { path: /healthz, port: 8080 }
failureThreshold: 30
periodSeconds: 5- Making the liveness probe check the database. A database outage would then restart every Pod in a loop — check only the process's own health in liveness.
How interviewers ask it“Walk me through resource requests and limits in Kubernetes. Where do they come up in real systems?”
What are resource requests and limits?
resources:
requests: { cpu: "250m", memory: "256Mi" }
limits: { memory: "512Mi" } # many teams omit the CPU limit to avoid throttlingQoS classes follow from these settings: Guaranteed (requests = limits for every container), Burstable, or BestEffort (none set — evicted first under memory pressure).
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata: { name: web }
spec:
ingressClassName: nginx
tls: [{ hosts: [interviewpitch.com], secretName: web-tls }]
rules:
- host: interviewpitch.com
http:
paths:
- path: /api
pathType: Prefix
backend: { service: { name: api, port: { number: 80 } } }Access modes: ReadWriteOnce (one node), ReadOnlyMany, ReadWriteMany (shared file systems such as EFS or NFS) and ReadWriteOncePod.
How interviewers ask it“How do rolling updates and rollbacks work under the hood? Take me through it step by step.”
How do rolling updates and rollbacks work?
kubectl set image deploy/api api=ghcr.io/acme/api:1.5.0
kubectl rollout status deploy/api
kubectl rollout history deploy/api
kubectl rollout undo deploy/api --to-revision=3How interviewers ask it“Walk me through the Horizontal Pod Autoscaler (HPA) in Kubernetes. Where does it come up in real systems?”
What is the Horizontal Pod Autoscaler (HPA)?
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata: { name: api }
spec:
scaleTargetRef: { apiVersion: apps/v1, kind: Deployment, name: api }
minReplicas: 3
maxReplicas: 20
metrics:
- type: Resource
resource: { name: cpu, target: { type: Utilization, averageUtilization: 70 } }VPA adjusts requests and limits per Pod; Cluster Autoscaler or Karpenter add and remove nodes.
kubectl taint nodes gpu-node-1 gpu=true:NoScheduleHow interviewers ask it“Walk me through init containers and sidecars in Kubernetes. Where do they come up in real systems?”
What are init containers and sidecars?
How interviewers ask it“Explain Helm in Kubernetes in detail — what should a new team member understand about it?”
What is Helm?
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install cache bitnami/redis -n infra --create-namespace -f values-prod.yaml
helm upgrade cache bitnami/redis -f values-prod.yaml
helm rollback cache 1How interviewers ask it“Explain Custom Resource Definitions (CRDs) and Operators in Kubernetes in detail — what should a new team member understand about them?”
What are Custom Resource Definitions (CRDs) and Operators?
How interviewers ask it“How would you explain a ServiceAccount to a junior engineer, and what do people most often get wrong?”
What is a ServiceAccount?
How interviewers ask it“Walk me through ResourceQuotas and LimitRanges in Kubernetes. Where do they come up in real systems?”
What are ResourceQuotas and LimitRanges?
How interviewers ask it“How would you explain a static Pod to a junior engineer, and what do people most often get wrong?”
What is a static Pod?
How interviewers ask it“Explain EndpointSlices in Kubernetes in detail — what should a new team member understand about them?”
What are EndpointSlices?
Advanced Kubernetes Interview Questions for Experienced Developers
11 questionsSenior-level Kubernetes questions on internals, performance, design and trade-offs — typical for 3, 5 and 7+ years of experience.
How interviewers ask it“How does networking work under the hood? Take me through it step by step.”
How does networking work in Kubernetes?
How interviewers ask it“How would you explain RBAC to a junior engineer, and what do people most often get wrong?”
What is RBAC in Kubernetes?
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata: { namespace: payments, name: pod-reader }
rules:
- apiGroups: [""]
resources: ["pods", "pods/log"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata: { namespace: payments, name: ci-reads-pods }
subjects: [{ kind: ServiceAccount, name: ci, namespace: payments }]
roleRef: { kind: Role, name: pod-reader, apiGroup: rbac.authorization.k8s.io }cluster-admin, and check permissions with kubectl auth can-i.How interviewers ask it“Walk me through NetworkPolicies in Kubernetes. Where do they come up in real systems?”
What are NetworkPolicies?
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata: { name: db-allow-api, namespace: payments }
spec:
podSelector: { matchLabels: { app: postgres } }
policyTypes: [Ingress]
ingress:
- from: [{ podSelector: { matchLabels: { app: api } } }]
ports: [{ port: 5432 }]How interviewers ask it“Suppose you need to secure a Kubernetes cluster — how do you approach it, and what can go wrong?”
How do you secure a Kubernetes cluster?
- RBAC with least privilege; disable automounted ServiceAccount tokens where they aren't needed
- Pod Security Standards (the
restrictedprofile): non-root, no privilege escalation, read-only root filesystem, dropped capabilities - NetworkPolicies with default-deny
- Encrypted Secrets at rest, or an external secret manager
- Signed and scanned images, plus admission policies (Kyverno, OPA Gatekeeper) that block unsafe workloads
- A private API endpoint, audit logging, and regular upgrades for supported versions and CVE fixes
How interviewers ask it“Explain a PodDisruptionBudget in Kubernetes in detail — what should a new team member understand about it?”
What is a PodDisruptionBudget?
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata: { name: api-pdb }
spec:
minAvailable: 2
selector: { matchLabels: { app: api } }How interviewers ask it“Walk me through GitOps in Kubernetes. Where does it come up in real systems?”
What is GitOps?
How interviewers ask it“How would you do blue-green and canary deployments? Walk me through your approach.”
How do you do blue-green and canary deployments in Kubernetes?
- Blue-green: run the new version (green) alongside the old (blue), then switch the Service selector or Ingress to green at once; roll back by switching back
- Canary: send a small percentage of traffic to the new version, watch metrics and increase it gradually — using weighted routing in the Gateway API or Ingress, a service mesh, or Argo Rollouts / Flagger to automate analysis and promotion
How interviewers ask it“Suppose you need to monitor and log a Kubernetes cluster — how do you approach it, and what can go wrong?”
How do you monitor and log a Kubernetes cluster?
- Metrics: Prometheus (with kube-state-metrics and node-exporter) plus Grafana dashboards; alert on SLOs, restarts, pending Pods and resource saturation
- Logs: apps log to stdout; a DaemonSet (Fluent Bit, Vector) ships logs to Loki, Elasticsearch or a cloud logging service
- Tracing: OpenTelemetry to Jaeger or Tempo
- Events:
kubectl get events, plus event exporters for history
- kubectl sends the manifest to the API server, which authenticates, authorises (RBAC) and runs admission controllers (mutating, then validating)
- The object is stored in etcd
- The Deployment controller sees it and creates a ReplicaSet; the ReplicaSet controller creates the Pod objects
- The scheduler assigns each Pod to a node
- That node's kubelet pulls the image through the container runtime, sets up the network (CNI) and volumes, and starts the containers
- Once readiness probes pass, the Pod is added to Service EndpointSlices and starts receiving traffic
How interviewers ask it“How would you upgrade a Kubernetes cluster safely? Walk me through your approach.”
How do you upgrade a Kubernetes cluster safely?
Kubernetes Troubleshooting Scenarios (CrashLoopBackOff, Pending, ImagePullBackOff)
6 questionsThe debugging questions that decide DevOps and SRE interviews. Walk through the exact kubectl commands and the most likely causes.
kubectl describe pod <pod> # exit code, last state, events, probe failures
kubectl logs <pod> --previous # logs from the crashed container
kubectl get events --sort-by=.lastTimestampCommon causes:
- An application error at startup (missing env var or config, bad DB URL)
- Exit code 137 /
OOMKilled→ raise the memory limit or fix a leak - A liveness probe failing too early → add a startup probe or a longer delay
- The wrong command or entrypoint, or a missing file
- A process that exits immediately because it doesn't stay in the foreground
Insufficient cpu/memory→ requests too high or the cluster is full; add nodes or let the autoscaler work- Node selectors, affinity rules or taints with no matching nodes
- PVC unbound — missing StorageClass, wrong zone, quota exceeded
- A namespace ResourceQuota has been exhausted
- Too many Pods per node or no free IPs (common with some cloud CNIs)
How interviewers ask it“Live coding: Fix ImagePullBackOff / ErrImagePull in Kubernetes. Talk me through your approach first.”
How do you fix ImagePullBackOff / ErrImagePull?
- A typo in the image name or tag, or the tag doesn't exist
- A private registry without credentials — create a
docker-registrySecret and reference it inimagePullSecrets(or use node or workload identity on the cloud) - Registry rate limits (Docker Hub), network or DNS problems from the nodes
- An architecture mismatch (an arm64-only image on amd64 nodes)
kubectl create secret docker-registry regcred \
--docker-server=ghcr.io --docker-username=$USER --docker-password=$TOKEN -n paymentskubectl get endpointslices -l kubernetes.io/service-name=api # are any Pods selected?
kubectl get pods -l app=api --show-labels # do the labels match the selector?
kubectl describe svc api # port vs targetPort
kubectl run tmp --rm -it --image=busybox -- wget -qO- http://api.payments.svc.cluster.localTypical culprits: the selector doesn't match the Pod labels; Pods aren't Ready (failing readiness probe); wrong targetPort; a NetworkPolicy blocking the traffic; DNS problems; or, from outside the cluster, a misconfigured Ingress or load balancer.
apiVersion: apps/v1
kind: Deployment
metadata: { name: web, labels: { app: web } }
spec:
replicas: 3
selector: { matchLabels: { app: web } }
template:
metadata: { labels: { app: web } }
spec:
securityContext: { runAsNonRoot: true, seccompProfile: { type: RuntimeDefault } }
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
labelSelector: { matchLabels: { app: web } }
containers:
- name: web
image: ghcr.io/acme/web:2.3.1
ports: [{ containerPort: 8080 }]
envFrom: [{ configMapRef: { name: web-config } }]
resources:
requests: { cpu: 200m, memory: 256Mi }
limits: { memory: 512Mi }
readinessProbe: { httpGet: { path: /ready, port: 8080 }, periodSeconds: 5 }
livenessProbe: { httpGet: { path: /healthz, port: 8080 }, initialDelaySeconds: 15 }
securityContext: { allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities: { drop: [ALL] } }
---
apiVersion: v1
kind: Service
metadata: { name: web }
spec:
selector: { app: web }
ports: [{ port: 80, targetPort: 8080 }]kubectl describe node <node>— check its conditions (MemoryPressure, DiskPressure, PIDPressure, NetworkUnavailable) and recent events- Check the kubelet and the container runtime on the node (
systemctl status kubelet,journalctl -u kubelet), and the CNI pods running on it - Look for disk full (images, logs), expired certificates, or the node losing contact with the API server
- Cordon and drain the node so workloads move elsewhere, fix or replace it (on the cloud, usually replace), then uncordon
kubectl cordon node-7
kubectl drain node-7 --ignore-daemonsets --delete-emptydir-dataPractise with the free Kubernetes quiz
Multiple-choice questions with instant feedback. Takes about 10 minutes and shows exactly which concepts to revise.
Start the Kubernetes quiz →