Kubernetes Scenario-Based Interview Questions (2027)

64 Kubernetes scenario-based interview questions with kubectl fixes: CrashLoopBackOff, Pending, OOMKilled, DNS, network policies, PVCs, HPA, RBAC.

Sep 10, 2025 - 16:36
Nov 7, 2026 - 00:05
 0  559
Kubernetes Scenario-Based Interview Questions (2027)

Kubernetes scenario-based interview questions describe a broken cluster or workload and ask how you would find and fix the cause. Expect pods in CrashLoopBackOff, Pending or OOMKilled, DNS failures, blocked network policies, unbound volumes, stuck rollouts, an HPA that will not scale, node pressure and RBAC "forbidden" errors. Answer with symptom, check, cause, fix and prevention.

This page has 64 scenario questions with answers and the kubectl commands you would actually run. The commands and default values were checked against the kubernetes.io documentation in November 2026, when Kubernetes 1.37 was the newest minor release. If you need the building blocks first, read our guide to the 12 must-know Kubernetes architecture components.

Key takeaways

  • Start almost every investigation with kubectl describe, kubectl get events and kubectl logs --previous. The Events section and the last termination reason usually name the cause.
  • CrashLoopBackOff is a symptom, not a cause. The kubelet restarts the container with a back-off of 10s, 20s, 40s and so on, capped at 5 minutes.
  • Pending pods are a scheduling problem (resources, taints, affinity, unbound PVCs). Running but unreachable pods are usually a readiness, selector, DNS or network policy problem.
  • Exit code 137 with reason OOMKilled means the container went over its memory limit. Raising the limit is only a fix after you know why memory grew.
  • Senior rounds add cluster-level scenarios: node pressure eviction, etcd backup and restore, upgrades within the version skew policy, expired certificates and multi-tenant RBAC.
  • Ingress NGINX was retired in March 2026 and gets no more fixes. Interviewers now expect you to know Gateway API as the replacement.

How to answer a Kubernetes scenario question

Interviewers care more about your order of work than about one perfect command. A good answer follows the same five steps every time.

StepWhat you sayTypical command
1. SymptomRestate what is broken and for whomkubectl get pods -o wide
2. EvidenceRead status, events and logs before changing anythingkubectl describe pod web-0
3. CauseName the most likely cause and how the evidence points to itkubectl logs web-0 --previous
4. FixApply the smallest safe change, through Git if the team uses GitOpskubectl rollout undo deployment/web
5. PreventionAdd a probe, limit, alert, policy or test so it does not repeatAlert on restarts, quotas, PDBs

The table below shows which questions to focus on for your level.

Your experienceRead firstPractise in a lab
Fresher or career switcherQuestions 1 to 18Break a Deployment on purpose (bad image, bad command, low memory limit) and fix it
2 to 5 yearsQuestions 19 to 44Network policies, PVC binding, rollouts, HPA with metrics-server, RBAC for service accounts
Senior or platform engineerQuestions 45 to 64Node pressure, etcd snapshot and restore, kubeadm upgrade, PDB-aware drains, multi-tenant design

Scenario questions for freshers

1. A pod shows CrashLoopBackOff. What do you do first?

Read the logs of the previous container run and the pod events. CrashLoopBackOff only says the container keeps exiting and the kubelet is waiting before the next restart.

kubectl get pod web-7d4f9 -o wide
kubectl describe pod web-7d4f9          # look at Last State, Exit Code, Events
kubectl logs web-7d4f9 --previous        # output of the crashed run
kubectl logs web-7d4f9 -c sidecar --previous   # if the pod has more than one container

Common causes are an application error at startup (exit code 1), a missing environment variable, Secret or ConfigMap key, a wrong command or arguments, a failing liveness probe and an out-of-memory kill (exit code 137). The kubelet restarts with an exponential delay of 10s, 20s, 40s and so on, capped at 300 seconds, and resets the timer after the container has run for 10 minutes without problems.

2. The logs are empty because the container dies too fast. How do you debug it?

Start a copy of the pod with the command replaced by a shell, or attach an ephemeral debug container. Both are built into kubectl debug.

# Copy the pod and open a shell instead of running the failing entrypoint
kubectl debug myapp -it --copy-to=myapp-debug --container=myapp -- sh

# Add an ephemeral container that shares the target container's process namespace
kubectl debug -it myapp --image=busybox:1.28 --target=myapp

Inside the shell, run the entrypoint by hand, check that config files and mounted Secrets exist, and confirm the user ID has permission to write where the app writes. Delete the copy when you finish.

3. A pod is stuck in ImagePullBackOff. What are the likely causes?

The kubelet cannot pull the image. The Events section of kubectl describe pod shows the exact registry error.

  • Wrong image name or tag (a typo, or a tag that was never pushed).
  • Private registry without credentials. Create a docker-registry Secret and reference it in imagePullSecrets or on the service account.
  • The node cannot reach the registry (proxy, firewall, DNS) or the registry is rate limiting anonymous pulls.
  • Architecture mismatch, for example an amd64-only image scheduled on an arm64 node.
kubectl create secret docker-registry regcred \
  --docker-server=registry.example.com \
  --docker-username=ci-bot --docker-password="$REG_TOKEN" -n shop
kubectl patch serviceaccount default -n shop \
  -p '{"imagePullSecrets":[{"name":"regcred"}]}'

4. A pod stays in Pending. How do you find out why?

Pending means the scheduler has not placed the pod, or the pod is waiting on a volume. Run kubectl describe pod and read the FailedScheduling event, which lists why each node was rejected.

kubectl describe pod api-5c8d7 | sed -n '/Events/,$p'
# Example: 0/3 nodes are available: 1 node(s) had untolerated taint, 2 Insufficient memory.
kubectl describe node worker-1 | grep -A8 "Allocated resources"

Typical reasons are requests larger than any node's free allocatable capacity, taints the pod does not tolerate, a nodeSelector or affinity no node matches, and a PersistentVolumeClaim that is not bound yet. Fix the request, add a toleration, correct the labels or add nodes. If a cluster autoscaler is installed, check its logs to see whether it tried to add a node.

5. The container was terminated with reason OOMKilled. What happened?

The container used more memory than its resources.limits.memory, so the kernel killed it. The exit code is 137 (128 + signal 9).

kubectl get pod worker-0 \
  -o jsonpath='{.status.containerStatuses[0].lastState.terminated.reason}{"\n"}'
kubectl top pod worker-0 --containers

Find out whether this is normal peak usage or a leak. Compare usage with the limit over time in your metrics system. For a JVM or Node.js app, check that the heap setting fits inside the container limit. If peak usage is genuine, raise the limit and the request together. If memory climbs until it is killed every time, fix the leak rather than hiding it with a larger limit.

6. A Service exists, but requests to it time out. What do you check?

Check that the Service actually has endpoints. A Service with no ready endpoints accepts the connection attempt but has nowhere to send it.

kubectl get svc web -o wide
kubectl get endpointslices -l kubernetes.io/service-name=web
kubectl get pods -l app=web --show-labels

Empty endpoints usually mean the Service selector does not match the pod labels, or the pods are not Ready because a readiness probe fails. Also confirm that targetPort matches the port the container listens on. A Service on port 80 with targetPort: 8080 fails if the app listens on 3000.

7. The pod is Running but shows 0/1 Ready. Why?

The readiness probe is failing, so the pod is removed from Service endpoints. The pod keeps running because readiness failures do not restart containers.

Look for Readiness probe failed in the events. Check the probe path, port and scheme, and test it from inside the pod with kubectl exec. A probe that calls a downstream database can mark every pod unready when that database is slow, so keep readiness checks focused on whether this pod can serve traffic.

8. A liveness probe keeps restarting a slow-starting Java app. How do you fix it?

Add a startupProbe. While the startup probe has not succeeded, the kubelet does not run liveness or readiness probes, so a slow start is no longer treated as a hang.

startupProbe:
  httpGet:
    path: /healthz
    port: 8080
  failureThreshold: 30
  periodSeconds: 10      # allows up to 300 seconds to start
livenessProbe:
  httpGet:
    path: /healthz
    port: 8080
  periodSeconds: 10

9. A pod is stuck in Init:0/1. What does that mean?

The first init container has not finished. Init containers run in order and each must exit with code 0 before the next one, and the app containers, can start.

kubectl logs api-6f9c -c wait-for-db
kubectl describe pod api-6f9c

A common case is an init container that loops until a database Service resolves. If the Service name is wrong or the database is down, the pod waits forever. Fix the dependency or the name.

10. You changed a ConfigMap, but the application still uses the old value. Why?

Environment variables from a ConfigMap are read only when the container starts. Mounted ConfigMap volumes are updated by the kubelet after a delay, but files mounted with subPath are never updated.

Restart the workload with kubectl rollout restart deployment/web. To make restarts automatic, many teams put a hash of the ConfigMap in a pod template annotation (Helm and Kustomize can do this), so a config change creates a new rollout.

11. A new deployment version is broken in production. How do you roll back?

Use the Deployment's revision history.

kubectl rollout history deployment/frontend
kubectl rollout undo deployment/frontend                  # previous revision
kubectl rollout undo deployment/frontend --to-revision=2  # specific revision
kubectl rollout status deployment/frontend

If the team uses GitOps with Argo CD or Flux, revert the commit instead. Otherwise the GitOps controller will reapply the broken version on its next sync.

12. A pod has been in Terminating for a long time. What do you check?

Check for finalizers and for a node that is no longer reporting. A pod with a finalizer is not removed until the controller that owns the finalizer clears it.

kubectl get pod stuck-pod -o jsonpath='{.metadata.finalizers}{"\n"}'
kubectl get node $(kubectl get pod stuck-pod -o jsonpath='{.spec.nodeName}')

If the node is gone, the kubelet cannot confirm the pod stopped. Force deletion (kubectl delete pod stuck-pod --grace-period=0 --force) removes the API object, but for StatefulSet pods it can lead to two pods with the same identity, so confirm the node is really down first.

13. kubectl returns "Error from server (Forbidden)". What does it mean?

Your identity was authenticated, but RBAC does not allow that verb on that resource in that namespace. Check what you are allowed to do before asking for more access.

kubectl auth whoami
kubectl auth can-i create deployments -n payments
kubectl auth can-i --list -n payments

14. Two pods of the same app keep landing on the same node. How do you spread them?

Use topologySpreadConstraints or pod anti-affinity. Spread constraints are the more flexible option because they allow a defined skew.

topologySpreadConstraints:
- maxSkew: 1
  topologyKey: kubernetes.io/hostname
  whenUnsatisfiable: ScheduleAnyway
  labelSelector:
    matchLabels:
      app: web

Use topology.kubernetes.io/zone as the key to spread across zones instead of nodes.

15. A Job keeps creating new pods that fail. When does it stop?

A Job retries failed pods until it reaches spec.backoffLimit, which defaults to 6, and then marks the Job failed. Read the logs of one failed pod to find the cause, and set activeDeadlineSeconds if the Job must never run longer than a fixed time.

16. Developers say "it works with docker run but not in Kubernetes". What differs?

The usual differences are the user ID, the file system and the network. Many clusters enforce non-root containers through Pod Security Admission, mount a read-only root file system, inject config through env vars and Secrets instead of a local .env file, and use Service DNS names instead of localhost. Compare the container's securityContext, volumes and env with the local run.

17. You applied a manifest and nothing happened. How do you check it?

Check that you are in the right context and namespace, then look at the object and its events.

kubectl config current-context
kubectl config view --minify | grep namespace
kubectl get deploy,rs,pods -n shop
kubectl events -n shop --types=Warning

A Deployment that exists with zero pods often has a ReplicaSet blocked by a ResourceQuota or an admission policy. kubectl describe rs shows the FailedCreate event.

18. A container uses image tag latest and nodes run different versions. Why?

Each node pulled latest at a different time, so the tag points to different images on different nodes. Use immutable tags (a version or Git SHA) or image digests, and keep imagePullPolicy: IfNotPresent for those tags. That makes rollbacks reproducible as well.

Scenario questions for 2 to 5 years of experience

19. Pods cannot resolve Service names. How do you troubleshoot DNS?

Test resolution from a debug pod, then check CoreDNS. The kubernetes.io DNS debugging guide uses a dnsutils pod for this.

kubectl apply -f https://k8s.io/examples/admin/dns/dnsutils.yaml
kubectl exec -i -t dnsutils -- nslookup kubernetes.default
kubectl exec -i -t dnsutils -- cat /etc/resolv.conf
kubectl get pods -n kube-system -l k8s-app=kube-dns
kubectl logs -n kube-system -l k8s-app=kube-dns

If kubernetes.default fails, look at CoreDNS pods, the kube-dns Service endpoints and the CoreDNS ConfigMap. If only external names fail, check the upstream forwarders. If DNS fails only from some namespaces, look for a NetworkPolicy that blocks egress to port 53.

20. External DNS lookups from pods are slow. What could cause it?

Pod resolv.conf uses options ndots:5 with several search domains, so a name like api.example.com is first tried with each cluster suffix before the real lookup. Use fully qualified names with a trailing dot for hot external calls, or lower ndots through the pod's dnsConfig. NodeLocal DNSCache also reduces latency and load on CoreDNS.

21. After adding a default-deny NetworkPolicy, every app broke. What went wrong?

A default-deny egress policy also blocks DNS. Pods cannot resolve any Service name, so every call fails. Allow DNS explicitly.

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-dns
  namespace: shop
spec:
  podSelector: {}
  policyTypes: ["Egress"]
  egress:
  - to:
    - namespaceSelector:
        matchLabels:
          kubernetes.io/metadata.name: kube-system
      podSelector:
        matchLabels:
          k8s-app: kube-dns
    ports:
    - protocol: UDP
      port: 53
    - protocol: TCP
      port: 53

Then add allow rules per app, for example frontend to backend on port 8080. See 10 Kubernetes network policies every engineer must know for more patterns.

22. You created a NetworkPolicy, but traffic is still allowed. Why?

NetworkPolicy is enforced by the CNI plugin. If the plugin does not support it, the API accepts the object and nothing happens. Confirm your CNI (Calico, Cilium and others) enforces policies. Also remember that policies are additive allow rules: a pod is isolated only when at least one policy selects it for that direction.

23. Pod A cannot reach pod B in another namespace. How do you narrow it down?

Test step by step: pod IP, Service IP, Service DNS name, then the policy.

kubectl exec -n team-a deploy/client -- wget -qO- -T 3 http://10.244.2.15:8080/health
kubectl exec -n team-a deploy/client -- wget -qO- -T 3 http://orders.team-b.svc.cluster.local:8080/health
kubectl get networkpolicy -n team-b

If the pod IP works but the DNS name does not, it is DNS or the Service. If neither works, check NetworkPolicies in both namespaces (egress in A, ingress in B) and the CNI pods on both nodes. Our 12 steps to debug networking in Kubernetes walks through this in more depth.

24. A PersistentVolumeClaim stays Pending. What do you check?

Run kubectl describe pvc and read the events.

  • No StorageClass named in the claim and no default StorageClass in the cluster.
  • The StorageClass uses volumeBindingMode: WaitForFirstConsumer. Then Pending is normal until a pod that uses the claim is scheduled.
  • The CSI driver or provisioner is not running, or it lacks cloud permissions.
  • For static provisioning, no PV matches the requested size, access mode and StorageClass.
kubectl get storageclass
kubectl describe pvc data-postgres-0
kubectl get pods -n kube-system | grep -i csi

25. During a rolling update the new pod fails with "Multi-Attach error". Why?

The Deployment uses a ReadWriteOnce volume. The new pod is scheduled on another node while the old pod still holds the volume, and a RWO block volume can attach to only one node at a time.

Use strategy.type: Recreate for a single-replica app with a RWO volume, or move stateful workloads to a StatefulSet with one claim per pod. If several pods really need the same data, use a storage class that supports ReadWriteMany.

26. A PV shows status Released and a new claim cannot bind to it. How do you reuse it?

With persistentVolumeReclaimPolicy: Retain, the PV keeps its data and its claimRef to the deleted claim, so it is not available. After checking the data, an administrator removes the claim reference.

kubectl patch pv pv-orders-01 --type=json \
  -p '[{"op":"remove","path":"/spec/claimRef"}]'

The PV becomes Available and can bind to a new claim that matches it.

27. A rollout is stuck and kubectl rollout status never finishes. What do you do?

Check the Deployment conditions. If new pods never become Ready, the Deployment reports Progressing=False with reason ProgressDeadlineExceeded after progressDeadlineSeconds, which defaults to 600.

kubectl rollout status deployment/api --timeout=120s
kubectl describe deployment api | sed -n '/Conditions/,/Events/p'
kubectl get rs -l app=api

Describe one of the new pods to see why it is not Ready (image pull, crash, probe, quota). Roll back with kubectl rollout undo if users are affected, then fix forward. Kubernetes does not roll back automatically on a missed deadline, so CI pipelines should fail the job when rollout status times out.

28. How do you make a rolling update with no dropped requests?

Combine readiness probes, a surge setting and graceful shutdown.

  • Set maxUnavailable: 0 and maxSurge: 1 (or 25%, the default for both) so capacity never drops.
  • Use a readiness probe so traffic goes only to pods that can serve.
  • Handle SIGTERM in the app and finish in-flight requests within terminationGracePeriodSeconds (default 30 seconds).
  • Add a short preStop sleep so load balancers and kube-proxy stop sending traffic before the process exits.
  • Add a PodDisruptionBudget so drains do not take out too many replicas at once.

29. The HPA shows TARGETS as <unknown>. Why does it not scale?

The HPA cannot read the metric. For CPU and memory, the Metrics API (usually metrics-server) must be installed, and the target pods must set resource requests, because utilization is calculated as a percentage of the request.

kubectl get hpa api
kubectl describe hpa api        # look for FailedGetResourceMetric
kubectl top pods -l app=api      # fails if metrics-server is missing
kubectl get apiservice v1beta1.metrics.k8s.io

30. Load went up, but the HPA scaled only slightly. Why?

The HPA computes desiredReplicas = ceil(currentReplicas x currentMetricValue / desiredMetricValue) and then applies maxReplicas and any scaling policies. Check whether you hit maxReplicas, whether new pods are Pending because the cluster is full, and whether CPU is the right signal. An I/O-bound or queue-driven service may need a custom or external metric such as requests per second or queue length.

31. The HPA scales down too slowly after a spike. Is that a bug?

No. For scale-down the default stabilization window is 300 seconds, so the HPA uses the highest recommendation from the last five minutes to avoid flapping. Tune spec.behavior.scaleDown if you need faster scale-down, and keep it conservative for services with slow start-up.

32. Can an HPA scale a queue worker to zero?

Yes, from Kubernetes 1.37 it is a beta feature enabled by default. The HPA must use an object or external metric (for example queue length), because CPU and memory metrics disappear when no pods run. Request-driven HTTP services still need a buffering layer, since Services do not hold requests while no pods are ready. Before 1.37 teams used tools such as KEDA for this.

33. A service account in a CI pipeline gets "forbidden" when it deploys. How do you fix it?

Grant the service account a namespaced Role with only the verbs it needs, then test with impersonation.

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: deployer
  namespace: shop
rules:
- apiGroups: ["apps"]
  resources: ["deployments"]
  verbs: ["get", "list", "watch", "create", "update", "patch"]
- apiGroups: [""]
  resources: ["services", "configmaps"]
  verbs: ["get", "list", "create", "update", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: ci-deployer
  namespace: shop
subjects:
- kind: ServiceAccount
  name: ci
  namespace: shop
roleRef:
  kind: Role
  name: deployer
  apiGroup: rbac.authorization.k8s.io
kubectl auth can-i patch deployments -n shop --as=system:serviceaccount:shop:ci

Avoid binding cluster-admin to pipeline accounts. Our post on RBAC in Kubernetes explains Roles, ClusterRoles and bindings.

34. Pod creation fails with "exceeded quota". What is happening?

A ResourceQuota in the namespace caps total requests, limits or object counts, and the new pod would go over it. When a quota covers CPU or memory, every pod must also set those requests or limits, or the API rejects it.

kubectl describe resourcequota -n team-a
kubectl get limitrange -n team-a -o yaml

A LimitRange can supply default requests and limits so pods without them are not rejected.

35. Pods are rejected with a Pod Security error after a namespace label change. Why?

Pod Security Admission enforces the level set by the namespace label pod-security.kubernetes.io/enforce. At restricted, pods must run as non-root, drop all capabilities, set a seccomp profile and disallow privilege escalation.

kubectl label ns shop pod-security.kubernetes.io/warn=restricted --overwrite
kubectl label ns shop pod-security.kubernetes.io/enforce=baseline --overwrite

Roll out a new level in warn or audit mode first, fix the workloads it reports, then switch to enforce.

36. A Secret was committed to Git in plain YAML. What do you do?

Treat the credential as leaked. Rotate it at the source first, then remove it from the repository history and replace it with an encrypted or external reference. Kubernetes Secrets are only base64 encoded, so the YAML is readable by anyone with repo access. Use Sealed Secrets, SOPS or the External Secrets Operator with a secret manager, and enable encryption at rest for Secrets in etcd.

37. An Ingress returns 404 for one path but works for others. What do you check?

Check that the request matches a rule: host header, path and pathType (Prefix or Exact). Then check that the backend Service and port in the rule exist and have endpoints, and that ingressClassName points to a controller that is running. A 502 or 503 usually means the controller found the rule but the backend had no ready pods.

38. Your cluster still runs ingress-nginx. What would you recommend?

Plan a migration. The Kubernetes project announced in November 2025 that Ingress NGINX would get best-effort maintenance until March 2026 and then no more releases, bug fixes or security updates. Existing installs keep working, but they will not be patched. The recommended path is Gateway API, and the ingress2gateway tool (1.0 released in March 2026) translates Ingress resources and over 30 common ingress-nginx annotations. We compare the options in Top 12 Kubernetes gateways for API traffic.

39. A StatefulSet pod is stuck and the next pods never start. Why?

With the default podManagementPolicy: OrderedReady, a StatefulSet creates pods one at a time and waits for each to be Running and Ready. If db-1 cannot become Ready, db-2 is never created. Fix the failing pod (often its PVC or a readiness probe). Use Parallel only if the app does not depend on start order.

40. A CronJob ran twice at the same time and corrupted data. How do you prevent it?

Set concurrencyPolicy: Forbid so a new run is skipped while the previous one is still active, and make the job idempotent. Also set startingDeadlineSeconds so a job that missed its schedule during an outage does not start much later than intended.

41. Requests and limits: a pod is throttled even though the node has idle CPU. Why?

A CPU limit caps the container through CFS quota regardless of idle CPU on the node, so latency-sensitive apps can be throttled during short bursts. Check throttling metrics (container_cpu_cfs_throttled_periods_total from cAdvisor). Many teams set CPU requests on every pod and remove or raise CPU limits for latency-sensitive services, while keeping memory limits.

42. A container needs more memory, but restarting it is costly. Can you resize it in place?

Yes. In-place pod resize is stable in current Kubernetes releases. You patch the resize subresource, and the container's resizePolicy decides whether a restart is needed for each resource.

kubectl patch pod resize-demo -n qos-example --subresource resize --patch \
  '{"spec":{"containers":[{"name":"pause","resources":{"requests":{"cpu":"800m"},"limits":{"cpu":"800m"}}}]}}'

For pods managed by a Deployment, also update the pod template, or the next rollout will return to the old values.

43. Logs from a pod disappeared after it restarted. How do you keep them?

kubectl logs --previous shows only the last terminated run, and logs are removed with the pod. Ship container logs to a central store with a node-level agent (Fluent Bit, Vector or the OpenTelemetry Collector) and keep application logs on stdout and stderr so the agent can collect them.

44. A Helm upgrade failed halfway and the release is stuck. What do you do?

Check the release history, then roll back to the last good revision.

helm history api -n shop
helm rollback api 7 -n shop
helm status api -n shop

If the release is stuck in pending-upgrade because a previous run was interrupted, roll back first. Use --atomic or --rollback-on-failure (the name depends on your Helm version) with --wait in CI so a failed upgrade rolls back automatically.

Scenario questions for senior and platform engineers

45. A node reports MemoryPressure and pods are being evicted. Explain what happens.

The kubelet monitors node resources and evicts pods when a hard eviction threshold is crossed. On Linux the default hard thresholds are memory.available<100Mi, nodefs.available<10%, imagefs.available<15% and nodefs.inodesFree<5%.

The kubelet ranks pods for eviction by whether their usage exceeds their requests, then by priority, then by usage relative to requests. BestEffort pods and Burstable pods using more than they requested go first. Evicted pods show status Failed with reason Evicted.

kubectl describe node worker-3 | sed -n '/Conditions/,/Addresses/p'
kubectl get pods -A --field-selector=status.phase=Failed

The long-term fix is accurate memory requests, reserved resources for system daemons (systemReserved, kubeReserved) and alerts before the node reaches the threshold.

46. A node has DiskPressure. What fills the disk and how do you clean it up?

Usually container images, container logs and emptyDir volumes. The kubelet garbage collects unused images first and then evicts pods. Check with kubectl debug node/worker-3 -it --image=ubuntu and inspect /host/var/lib/containerd and /host/var/log/pods. Prevent it with log rotation settings in the kubelet, ephemeral-storage requests and limits on pods, and sizeLimit on emptyDir volumes.

47. A node is NotReady. How do you investigate?

Check the node conditions, then the kubelet and the container runtime on the node.

kubectl describe node worker-2
kubectl debug node/worker-2 -it --image=ubuntu    # if the node can still run pods
# On the node itself (SSH or console):
systemctl status kubelet containerd
journalctl -u kubelet --since "30 min ago"

Typical causes are a stopped kubelet, an expired kubelet client certificate, a crashed container runtime, a broken CNI plugin (the node reports that the network is not ready), disk full, or lost network to the API server. Pods on the node are evicted after the taint-based eviction timeout, so stateful workloads may need manual attention.

48. You must drain a node for maintenance, but the drain hangs. Why?

A PodDisruptionBudget is blocking eviction. If a PDB requires minAvailable: 2 and only two replicas are healthy, the eviction API refuses to evict either pod.

kubectl cordon worker-4
kubectl drain worker-4 --ignore-daemonsets --delete-emptydir-data --timeout=10m
kubectl get pdb -A

Scale the workload up or fix unhealthy replicas so the budget allows a disruption. Do not delete the PDB to force the drain unless the owners agree, because that is exactly the outage the PDB exists to prevent.

49. How do you back up and restore etcd on a kubeadm cluster?

Take a snapshot with etcdctl, verify it with etcdutl, and restore with etcdutl. Restoring with etcdctl has been deprecated since etcd 3.5.

ETCDCTL_API=3 etcdctl --endpoints=https://127.0.0.1:2379 \
  --cacert=/etc/kubernetes/pki/etcd/ca.crt \
  --cert=/etc/kubernetes/pki/etcd/server.crt \
  --key=/etc/kubernetes/pki/etcd/server.key \
  snapshot save /backup/etcd-$(date +%F).db

etcdutl --write-out=table snapshot status /backup/etcd-2026-11-07.db

etcdutl --data-dir /var/lib/etcd-restore snapshot restore /backup/etcd-2026-11-07.db
# then point the etcd static pod manifest at /var/lib/etcd-restore

Copy snapshots off the control plane nodes, encrypt them, and test a restore in a lab regularly. A backup you have never restored is a guess.

50. How do you upgrade a kubeadm cluster from 1.36 to 1.37 safely?

Upgrade one minor version at a time: control plane first, then nodes, one node at a time.

# On the first control plane node, after upgrading the kubeadm package
kubeadm upgrade plan
kubeadm upgrade apply v1.37.1
# On the other control plane nodes
kubeadm upgrade node
# For each worker
kubectl drain worker-1 --ignore-daemonsets --delete-emptydir-data
# upgrade kubeadm, run kubeadm upgrade node, upgrade kubelet and kubectl, restart kubelet
kubectl uncordon worker-1

Before you start, take an etcd snapshot, read the release notes for removed APIs, and check add-ons (CNI, CSI, ingress or gateway controllers) for compatibility. The version skew policy allows a kubelet up to three minor versions older than the API server, but never newer.

51. Every kubectl command fails with an x509 certificate expired error. What happened?

On kubeadm clusters, control plane certificates last one year by default and are renewed during kubeadm upgrade. A cluster that has not been upgraded for a year can hit expiry.

kubeadm certs check-expiration
kubeadm certs renew all
# restart the control plane static pods (kube-apiserver, controller-manager, scheduler, etcd)
# and update admin.conf for kubectl users

Add monitoring for certificate expiry so this becomes a planned task instead of an outage.

52. A namespace is stuck in Terminating. How do you fix it?

Some resource in the namespace still has a finalizer, often a custom resource whose controller or CRD was removed first, or an unavailable aggregated API.

kubectl get namespace old-team -o jsonpath='{.status.conditions}{"\n"}'
kubectl api-resources --verbs=list --namespaced -o name \
  | xargs -n 1 kubectl get --show-kind --ignore-not-found -n old-team

Fix the cause (restore the controller so it can clean up, or fix the APIService). Removing finalizers by hand is a last resort, because it can leave cloud resources such as load balancers or disks behind.

53. A critical pod cannot schedule because the cluster is full. How do you make sure it runs?

Give it a higher PriorityClass. When a high-priority pod cannot be scheduled, the scheduler can preempt lower-priority pods to make room. Use priority sparingly and pair it with quotas, or teams will mark everything as critical. For capacity, use a cluster autoscaler or Karpenter so pending pods trigger new nodes.

54. One team's batch jobs starve other teams on a shared cluster. How do you design for this?

Give each team its own namespace with a ResourceQuota and LimitRange, require requests on all pods, and use PriorityClasses so production services outrank batch work. Put batch jobs on a separate node pool with taints and tolerations, and add NetworkPolicies and RBAC per namespace. Separate clusters give stronger isolation when teams need different Kubernetes versions or strict compliance boundaries.

55. Someone deleted a production Deployment with kubectl. How do you recover and prevent it?

If the manifests live in Git with Argo CD or Flux, the controller recreates the Deployment on its next sync, or you trigger a sync. Without GitOps, reapply from your CI artifacts or Helm (helm rollback or helm upgrade with the last values). To prevent it, remove direct write access to production for humans, use GitOps as the only deploy path, enable API audit logging, and back up cluster objects with a tool such as Velero.

56. The API server is slow and kubectl commands time out. What do you check?

Check API server and etcd health and load. Look at API server request latency and the rate of requests per client, etcd disk latency (etcd needs fast disks) and database size. A common cause is a misbehaving controller or script that lists large resources in a tight loop. API Priority and Fairness can protect important traffic, and audit logs show which user agent is sending the requests.

57. A pod needs to call the cloud provider API. How do you give it credentials safely?

Use workload identity instead of static keys in Secrets: EKS Pod Identity or IRSA on AWS, Workload Identity Federation on GKE, and Microsoft Entra Workload ID on AKS. Each binds a Kubernetes service account to a cloud identity with short-lived tokens. Grant only the permissions that workload needs.

58. Images with critical CVEs keep reaching production. How do you stop that?

Scan images in CI and fail the build on policy, sign images, and enforce rules at admission time. A ValidatingAdmissionPolicy, Kyverno or OPA Gatekeeper can reject images from untrusted registries, images without signatures, or pods that run as root. Rescan running images regularly, since new CVEs are published after deployment.

59. A canary release is needed with 5% of traffic to the new version. How would you do it?

Plain Deployments can only approximate this by replica ratio. For precise weights, use Gateway API HTTPRoute with weighted backendRefs, a service mesh, or a progressive delivery tool such as Argo Rollouts or Flagger that shifts traffic in steps and rolls back on bad metrics.

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: checkout
spec:
  parentRefs:
  - name: public-gateway
  rules:
  - backendRefs:
    - name: checkout-v1
      port: 8080
      weight: 95
    - name: checkout-v2
      port: 8080
      weight: 5

60. Pods are evicted on spot or preemptible nodes. How do you keep the service up?

Run enough replicas spread across zones and node types, set PodDisruptionBudgets, handle SIGTERM quickly, and keep stateful or singleton workloads on on-demand nodes using node affinity and taints. Node termination handlers (or the managed equivalent) cordon and drain spot nodes when the provider sends the interruption notice.

61. A cluster-wide outage followed a CNI upgrade. How do you recover and avoid repeats?

Roll the CNI DaemonSet back to the previous version, confirm node network readiness and pod-to-pod traffic, and restart pods that came up without networking. For the future, upgrade the CNI in a staging cluster with the same configuration first, use a canary node pool, read the vendor's upgrade notes for your exact version path, and keep the previous manifests or Helm values ready.

62. How would you troubleshoot intermittent 5xx errors that you cannot reproduce?

Correlate. Check whether errors line up with deployments, HPA scale events, node evictions or pod restarts. Look at gateway and service metrics by pod to see whether one pod or node is responsible. Common causes are pods receiving traffic during shutdown (no preStop delay), readiness probes that pass too early, connection limits on the database, and CPU throttling. Distributed tracing shows which hop fails.

63. Design how you would run the same application on three clusters in different regions.

Keep one Git repository as the source of truth with per-cluster overlays (Kustomize or Helm values), and use Argo CD ApplicationSets or Flux to deploy to all clusters. Put a global load balancer or DNS-based routing in front, keep data replication as an explicit design decision per service, and standardise policies, RBAC and observability across clusters.

64. After an incident, what do you put in the post-incident review?

A timeline, the impact, the root cause and contributing factors, what detected the problem (or why nothing did), and follow-up actions with owners. For Kubernetes incidents, actions are usually concrete: a missing PDB, a probe that checks too much, no memory request, an alert on ProgressDeadlineExceeded, or a policy that blocks latest tags. Keep the review blameless so people share what really happened.

Kubernetes troubleshooting command reference

SymptomFirst commandsUsual causes
CrashLoopBackOffkubectl logs POD --previous, kubectl describe pod PODApp error, missing config, bad command, liveness probe, OOM
ImagePullBackOffkubectl describe pod PODWrong tag, missing pull secret, registry unreachable
Pendingkubectl describe pod POD, kubectl describe nodeInsufficient resources, taints, affinity, unbound PVC
OOMKilled (137)kubectl top pod --containersLimit too low, memory leak, heap larger than limit
Running, not Readykubectl describe pod, kubectl get endpointslicesReadiness probe, selector mismatch, wrong targetPort
DNS failureskubectl exec dnsutils -- nslookup kubernetes.defaultCoreDNS down, policy blocks port 53, upstream DNS
Forbiddenkubectl auth can-i ... --as=...Missing Role or RoleBinding, wrong namespace
Stuck rolloutkubectl rollout status, kubectl describe deployNew pods not Ready, quota, ProgressDeadlineExceeded
Node pressurekubectl describe nodeMissing requests, logs or images filling disk

For a longer list of commands, see Top 15 Kubernetes troubleshooting commands.

How to prepare for Kubernetes scenario rounds

Build a small cluster with kind, minikube or kubeadm and break it on purpose: a wrong image tag, a 64Mi memory limit on a Java app, a default-deny NetworkPolicy, a PVC with a missing StorageClass, a Role without the patch verb. Fix each one using only the commands on this page, and say each step out loud as you would in the interview. Then practise the senior tasks, especially an etcd snapshot and restore and a one-minor-version kubeadm upgrade.

For conceptual questions, pair this page with our 150+ Kubernetes interview questions and the broader 200+ DevOps interview questions guide.

If you want guided lab practice, DevOps Training Institute runs classroom batches in Kharadi, Pune and live online classes across India. The CKA course covers cluster troubleshooting, etcd backup and upgrades, and the CKAD course covers probes, rollouts and application debugging.

References

FAQs

What are the most common Kubernetes scenario-based interview questions?

CrashLoopBackOff, ImagePullBackOff, Pending pods, OOMKilled containers, Services with no endpoints, DNS failures, NetworkPolicies that block traffic, PVCs stuck in Pending, stuck rollouts, HPAs that do not scale, node pressure evictions and RBAC "forbidden" errors come up in most interviews.

How should I structure my answer to a troubleshooting question?

State the symptom, say which command or log you would check first, explain the most likely cause from that evidence, describe the fix, and finish with how you would prevent it. Interviewers value a calm, ordered process more than one memorised command.

What does CrashLoopBackOff actually mean?

It means the container keeps exiting and the kubelet is waiting before restarting it again. The delay doubles from 10 seconds up to 5 minutes. The cause is in the previous container's logs and exit code, which you read with kubectl logs --previous and kubectl describe pod.

What is the difference between OOMKilled and an eviction?

OOMKilled means one container went over its own memory limit and the kernel killed it, so the container restarts in the same pod. An eviction means the kubelet removed the whole pod because the node ran low on memory, disk or process IDs.

Do I need to know Gateway API for Kubernetes interviews in 2027?

Yes. Ingress NGINX was retired in March 2026 and no longer receives security fixes, and Gateway API is the replacement the Kubernetes project recommends. Know GatewayClass, Gateway and HTTPRoute, and how weighted backendRefs support canary releases.

Which kubectl commands should I know by heart?

kubectl get, describe, logs (with --previous and -c), events, exec, debug, top, rollout status, history and undo, auth can-i, cordon, drain and uncordon. Most scenario answers use only these.

How do I practise Kubernetes scenarios without a cloud account?

Use kind or minikube on a laptop. Break things deliberately (bad image tags, low memory limits, default-deny policies, missing StorageClasses, missing RBAC verbs) and fix them. Use a kubeadm lab on virtual machines for etcd backup and upgrade practice.

Is the CKA exam useful for scenario-based interviews?

Yes. The CKA is a hands-on exam built around cluster troubleshooting, networking, storage, upgrades and etcd backup, which are the same skills scenario rounds test. Employers rarely require it, but preparing for it gives you structured practice.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 1
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.