Skip to content
  1. Home
  2. Interview Questions
  3. Kubernetes
Cloud & DevOps

50 Kubernetes Interview Questions and Answers (2026)

The most asked Kubernetes interview questions with structured answers — a quick answer, a clear explanation and working code for each. Covers basics for freshers through advanced, scenario and coding questions for experienced developers.

Updated November 2026 Reviewed by Abhishek Kumar 60 min read
50Questions
12Freshers
21Intermediate
11Experienced

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 questions

Start here if you are a fresher or switching to Kubernetes. These fundamentals are asked in almost every first-round and campus interview.

BeginnerKubernetes
Quick answerKubernetes is a container orchestrator. You declare the desired state ("run 3 replicas of this image, reachable on port 80"), and Kubernetes continuously works to make the actual state match it.

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.

How interviewers ask it“Explain the Kubernetes architecture, ideally with an example from a project you've worked on.”

Explain the Kubernetes architecture.

BeginnerKubernetes
Quick answerControl plane:
  • kube-apiserver: the front door — every component and kubectl talk 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
💡 Interview tip: Explain the reconcile loop — "observe, compare, act" — because it is the core idea behind everything else.

How interviewers ask it“Let's start with the basics — how would you explain a Pod in Kubernetes?”

What is a Pod?

BeginnerKubernetes
Quick answerA Pod is the smallest deployable unit in Kubernetes: one or more containers that share a network namespace (one IP, localhost between them) and storage volumes, and are always scheduled together on the same node. Pods are ephemeral; you rarely create them directly — controllers such as Deployments manage them.
YAML
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?

BeginnerKubernetes
Quick answerA Deployment manages stateless applications. It owns a ReplicaSet that keeps N identical Pods running, and handles rolling updates and rollbacks when you change the Pod template (a new image, say).
YAML
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 }]
BeginnerKubernetes
Quick answerA Service gives a stable virtual IP and DNS name to a changing set of Pods (selected by labels) and load-balances traffic across them.
TypeReachable fromUse
ClusterIP (default)Inside the clusterService-to-service traffic
NodePort<NodeIP>:<30000–32767>Simple external access, testing
LoadBalancerA cloud load balancer IPExposing a service externally on a cloud
ExternalNameA DNS CNAME aliasPointing to an external service
Headless (clusterIP: None)Direct Pod IPs through DNSStatefulSets, 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?

BeginnerKubernetes
Quick answerNamespaces divide one cluster into virtual sub-clusters for teams, environments or apps. They scope names, RBAC permissions, resource quotas and network policies. Some resources (Nodes, PersistentVolumes, ClusterRoles) are cluster-wide rather than namespaced.
Shell
kubectl create namespace payments
kubectl get pods -n payments

How interviewers ask it“Let's start with the basics — how would you explain labels and selectors in Kubernetes?”

What are labels and selectors?

BeginnerKubernetes
Quick answerLabels are key-value pairs attached to objects (app: api, env: prod). Selectors pick objects by label — Services use them to find Pods, Deployments to own their Pods, and you use them with kubectl get pods -l app=api. Annotations, by contrast, hold non-identifying metadata for tools.
BeginnerKubernetes
Quick answerkubectl is the command-line client for the Kubernetes API.
Shell
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?

BeginnerKubernetes
Quick answerA ConfigMap stores non-sensitive configuration (environment variables, config files). A Secret stores sensitive data (passwords, tokens, TLS keys). Both can be injected as environment variables or mounted as files.

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).

YAML
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?

BeginnerKubernetes
Quick answerImperative: you tell Kubernetes what to do step by step (kubectl create, kubectl scale, kubectl set image). Declarative: you describe the desired state in YAML, keep it in git, and kubectl apply it, letting Kubernetes work out the changes. Declarative manifests plus GitOps (Argo CD, Flux) is the production standard.

How interviewers ask it“In simple words, what is a DaemonSet? Explain it like you would to a new teammate.”

What is a DaemonSet?

BeginnerKubernetes
Quick answerA DaemonSet runs one copy of a Pod on every node (or on selected nodes), and automatically adds it to new nodes. It is used for node-level agents: log collectors (Fluent Bit), monitoring (node-exporter), CNI plugins and security agents.

Intermediate Kubernetes Interview Questions

21 questions

Questions for candidates with 1–3 years of experience — the concepts interviewers use to check that you have actually built things with Kubernetes.

IntermediateKubernetes
Quick answerUse a StatefulSet for stateful apps that need stable identity and storage: databases, Kafka, ZooKeeper, Elasticsearch.
DeploymentStatefulSet
Pod namesRandom (api-7d9f-x2)Stable, ordered (db-0, db-1)
StorageUsually shared or noneOne PersistentVolumeClaim per Pod via volumeClaimTemplates
Startup and scalingParallelOrdered (by default)
Network identityThrough the ServiceA 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?

IntermediateKubernetes
Quick answerA Job runs Pods until a task completes successfully a set number of times — migrations, batch processing — with retries (backoffLimit). A CronJob creates Jobs on a schedule.
YAML
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
IntermediateKubernetes
  • 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
YAML
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
Common mistakes
  • 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?

IntermediateKubernetes
Quick answerRequests are what the scheduler reserves for a container; a Pod is placed only on a node with enough unreserved capacity. Limits are hard caps: exceeding the CPU limit causes throttling, while exceeding the memory limit gets the container OOMKilled.
YAML
resources:
  requests: { cpu: "250m", memory: "256Mi" }
  limits:   { memory: "512Mi" }   # many teams omit the CPU limit to avoid throttling

QoS classes follow from these settings: Guaranteed (requests = limits for every container), Burstable, or BestEffort (none set — evicted first under memory pressure).

IntermediateKubernetes
Quick answerAn Ingress defines HTTP(S) routing rules (host and path → Service) and TLS termination, implemented by an Ingress controller such as NGINX, Traefik or a cloud controller. The Gateway API is its more expressive successor, with role-oriented resources (GatewayClass, Gateway, HTTPRoute), traffic splitting and header matching. New platforms increasingly adopt the Gateway API.
YAML
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 } } }
IntermediateKubernetes
Quick answerA PersistentVolume (PV) is a piece of storage in the cluster. A PersistentVolumeClaim (PVC) is a Pod's request for storage (size and access mode). A StorageClass enables dynamic provisioning: when a PVC is created, the CSI driver creates a matching disk (EBS, Persistent Disk, Azure Disk) automatically.

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?

IntermediateKubernetes
Quick answerWhen you change a Deployment's Pod template, Kubernetes creates a new ReplicaSet and shifts Pods over gradually according to maxSurge (extra Pods allowed) and maxUnavailable (Pods allowed to be down). Readiness probes gate the progress. kubectl rollout undo scales the previous ReplicaSet back up.
Shell
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=3

How 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)?

IntermediateKubernetes
Quick answerThe HPA automatically scales a Deployment's replica count based on metrics — CPU or memory utilisation relative to requests, or custom/external metrics such as requests per second or queue length. It needs metrics-server (or Prometheus Adapter / KEDA for custom metrics).
YAML
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.

IntermediateKubernetes
Quick answerTaints on a node repel Pods unless the Pods have matching tolerations — used to dedicate GPU nodes or keep workloads off control-plane nodes. Node affinity attracts Pods to nodes with certain labels (required or preferred). Pod (anti-)affinity places Pods near or away from other Pods — for example, spreading replicas across zones. topologySpreadConstraints is the modern way to spread replicas evenly.
Shell
kubectl taint nodes gpu-node-1 gpu=true:NoSchedule

How 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?

IntermediateKubernetes
Quick answerInit containers run to completion, in order, before the app containers start — waiting for dependencies, running migrations, fetching config. Sidecars run alongside the main container for its whole life — log shippers, service-mesh proxies, config reloaders. Kubernetes now has native sidecar support: an init container with restartPolicy: Always starts before the app and stops after it.

How interviewers ask it“Explain Helm in Kubernetes in detail — what should a new team member understand about it?”

What is Helm?

IntermediateKubernetes
Quick answerHelm is the package manager for Kubernetes. A chart is a templated bundle of manifests plus default values.yaml; a release is an installed instance of a chart. Helm handles install, upgrade and rollback, and lets you reuse charts across environments with different values.
Shell
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 1
IntermediateKubernetes
Quick answerKustomize (built into kubectl apply -k) customises plain YAML with overlays and patches — a base plus per-environment differences — without templates. Helm uses Go templating and adds packaging, versioning and release management. Many teams use Helm for third-party software and Kustomize for their own apps; GitOps tools support both.
IntermediateKubernetes
Quick answeretcd is the distributed, strongly consistent key-value store (it uses the Raft consensus algorithm) where Kubernetes stores all cluster state: every object, Secret and configuration. Losing etcd means losing the cluster's desired state. Run it with an odd number of members (3 or 5) for quorum, and take regular snapshots (etcdctl snapshot save). Managed Kubernetes services handle this for you.

How 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?

IntermediateKubernetes
Quick answerA CRD extends the Kubernetes API with your own resource types (for example kind: PostgresCluster). An Operator is a controller that watches those custom resources and encodes operational knowledge — provisioning, backups, failover, upgrades — in a reconcile loop. Examples include cert-manager, Prometheus Operator, Strimzi (Kafka) and CloudNativePG.

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?

IntermediateKubernetes
Quick answerA ServiceAccount is an identity for processes running in Pods, used to authenticate to the Kubernetes API, with permissions granted through RBAC. Pods receive short-lived, automatically rotated tokens through projected volumes. On clouds, ServiceAccounts can map to cloud IAM roles (IRSA / EKS Pod Identity, GKE Workload Identity) so Pods get cloud access without static keys.

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?

IntermediateKubernetes
Quick answerA ResourceQuota caps a namespace's total consumption — CPU and memory requests and limits, number of Pods, PVCs, LoadBalancers — so one team can't exhaust the cluster. A LimitRange sets default and minimum/maximum requests and limits for each container in a namespace, so Pods without explicit resources still get sensible values.
IntermediateKubernetes
Quick answerkubectl create creates a resource and fails if it already exists (imperative). kubectl replace overwrites the whole object, and fails if it doesn't exist. kubectl apply is declarative: it creates the resource or patches it, computing the difference with the last-applied configuration (or using server-side apply) — the standard for GitOps and CI.
IntermediateKubernetes
Quick answerCoreDNS gives every Service a name of the form <service>.<namespace>.svc.cluster.local. Inside the same namespace, http://api works; across namespaces, use api.payments. Headless Services return the individual Pod IPs, and StatefulSet Pods get stable names such as db-0.db.payments.svc.cluster.local.
IntermediateKubernetes
Quick answerIt depends on how the ConfigMap is consumed. When it is mounted as a volume, the files are updated eventually (after the kubelet sync delay), but the app must re-read them. When it is used as environment variables (or through subPath mounts), nothing changes until the Pod restarts. A common pattern is a config hash annotation on the Pod template, which triggers a rolling restart whenever the config changes.

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?

IntermediateKubernetes
Quick answerA static Pod is managed directly by the kubelet on one node, from manifest files in a directory (usually /etc/kubernetes/manifests), not by the API server. kubeadm runs the control-plane components (apiserver, scheduler, controller-manager, etcd) as static Pods. The API server only shows a read-only "mirror Pod" for each.

How interviewers ask it“Explain EndpointSlices in Kubernetes in detail — what should a new team member understand about them?”

What are EndpointSlices?

IntermediateKubernetes
Quick answerEndpointSlices hold the list of IPs and ports of the ready Pods behind a Service, split into chunks (100 endpoints per slice by default). They replaced the single large Endpoints object, which was expensive to update in big clusters. kube-proxy and service meshes watch EndpointSlices to program routing.

Advanced Kubernetes Interview Questions for Experienced Developers

11 questions

Senior-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?

AdvancedKubernetes
Quick answerThe Kubernetes network model requires that every Pod gets its own IP, and that any Pod can reach any other Pod without NAT. A CNI plugin (Calico, Cilium, Flannel, or the cloud VPC CNI) implements this. Services give stable virtual IPs, implemented by kube-proxy (iptables/IPVS) or eBPF. CoreDNS resolves names such as api.payments.svc.cluster.local.

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?

AdvancedKubernetes
Quick answerRole-Based Access Control grants permissions on API resources. A Role (namespaced) or ClusterRole lists allowed verbs on resources; a RoleBinding or ClusterRoleBinding grants it to users, groups or ServiceAccounts (the identities Pods use).
YAML
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 }
💡 Interview tip: Follow least privilege — avoid binding 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?

AdvancedKubernetes
Quick answerBy default, every Pod can talk to every other Pod. NetworkPolicies restrict ingress and egress traffic by Pod labels, namespaces and ports, enabling zero-trust segmentation. They need a CNI that enforces them (Calico, Cilium).
YAML
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?

AdvancedKubernetes
  • RBAC with least privilege; disable automounted ServiceAccount tokens where they aren't needed
  • Pod Security Standards (the restricted profile): 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?

AdvancedKubernetes
Quick answerA PDB limits how many replicas of an application can be down at the same time during voluntary disruptions — node drains, upgrades, autoscaler scale-downs. For example, minAvailable: 2 keeps at least two Pods running while nodes are drained one by one.
YAML
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata: { name: api-pdb }
spec:
  minAvailable: 2
  selector: { matchLabels: { app: api } }
AdvancedKubernetes
Quick answerA service mesh (Istio, Linkerd, Cilium) adds a networking layer — sidecar proxies or node-level/ambient proxies — that provides mTLS between services, retries, timeouts, traffic splitting (canaries), and uniform metrics and tracing without changing application code. It is worth it for many services with strict security or traffic-control needs; for a handful of services it is often unnecessary complexity.

How interviewers ask it“Walk me through GitOps in Kubernetes. Where does it come up in real systems?”

What is GitOps?

AdvancedKubernetes
Quick answerGitOps uses a git repository as the single source of truth for cluster state. A controller in the cluster (Argo CD or Flux) continuously syncs the manifests from git and reverts drift. Deployments become pull requests: reviewable, auditable and easy to roll back with git revert.

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?

AdvancedKubernetes
  • 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?

AdvancedKubernetes
  • 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
AdvancedKubernetes
  1. kubectl sends the manifest to the API server, which authenticates, authorises (RBAC) and runs admission controllers (mutating, then validating)
  2. The object is stored in etcd
  3. The Deployment controller sees it and creates a ReplicaSet; the ReplicaSet controller creates the Pod objects
  4. The scheduler assigns each Pod to a node
  5. That node's kubelet pulls the image through the container runtime, sets up the network (CNI) and volumes, and starts the containers
  6. 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?

AdvancedKubernetes
Quick answerRead the release notes and deprecated-API guides first (check manifests with tools such as pluto or kubent), then upgrade the control plane one minor version at a time, then the node pools: cordon and drain each node (respecting PDBs) or roll in new nodes with the new version. Upgrade add-ons (CNI, CoreDNS, ingress) to compatible versions, and test in staging first. Managed services (EKS, GKE, AKS) automate much of this.

Kubernetes Troubleshooting Scenarios (CrashLoopBackOff, Pending, ImagePullBackOff)

6 questions

The debugging questions that decide DevOps and SRE interviews. Walk through the exact kubectl commands and the most likely causes.

CodingKubernetes
Quick answerCrashLoopBackOff means the container starts, exits, and the kubelet keeps restarting it with increasing back-off delays.
Shell
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=.lastTimestamp

Common 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
CodingKubernetes
Quick answerPending means the Pod hasn't been scheduled, or its volumes can't be attached. Run kubectl describe pod and read the Events:
  • 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?

CodingKubernetes
Quick answerThe kubelet can't pull the image. Check kubectl describe pod for the exact message:
  • A typo in the image name or tag, or the tag doesn't exist
  • A private registry without credentials — create a docker-registry Secret and reference it in imagePullSecrets (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)
Shell
kubectl create secret docker-registry regcred \
  --docker-server=ghcr.io --docker-username=$USER --docker-password=$TOKEN -n payments
CodingKubernetes
Quick answerDebug one layer at a time:
Shell
kubectl 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.local

Typical 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.

CodingKubernetes
YAML
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 }]
CodingKubernetes
  1. kubectl describe node <node> — check its conditions (MemoryPressure, DiskPressure, PIDPressure, NetworkUnavailable) and recent events
  2. Check the kubelet and the container runtime on the node (systemctl status kubelet, journalctl -u kubelet), and the CNI pods running on it
  3. Look for disk full (images, logs), expired certificates, or the node losing contact with the API server
  4. Cordon and drain the node so workloads move elsewhere, fix or replace it (on the cloud, usually replace), then uncordon
Shell
kubectl cordon node-7
kubectl drain node-7 --ignore-daemonsets --delete-emptydir-data

Practise 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 →

Kubernetes interview FAQ

What Kubernetes questions are asked for DevOps engineers?
Kubernetes architecture (control plane and nodes), Pods vs Deployments vs StatefulSets, Services and Ingress, ConfigMaps and Secrets, probes, resource requests and limits, HPA, RBAC, network policies, persistent volumes, Helm, rolling updates and rollbacks, and troubleshooting CrashLoopBackOff, ImagePullBackOff and Pending pods.
How do I prepare for a Kubernetes interview?
Run a local cluster (kind, minikube or k3d), deploy an app with a Deployment, Service, Ingress, ConfigMap and Secret, break it on purpose and fix it with kubectl describe, logs and events, then learn autoscaling, RBAC and Helm. Certifications such as CKA or CKAD are a good structured path.
Is Docker required to learn Kubernetes?
You need to understand containers and images, which most people learn with Docker. Kubernetes itself runs containers through containerd or CRI-O, but any OCI image you build with Docker runs on Kubernetes unchanged.
AK
Written and reviewed by Abhishek Kumar
Founder, InterviewPitch · 10+ years in IT. Questions are collected from real interview rounds and refreshed regularly. Spotted an error? Tell us.