Home › Interview questions › Kubernetes
Kubernetes Interview Questions & Answers
82 Kubernetes interview questions in 4 levels — junior to senior, plus 20 production scenarios. Read 3 free answers with real-world analogies.
Free sample answers
What is Kubernetes and why do we need it?
One-liner
Kubernetes is a container orchestration platform that automates deploying, scaling, and healing containerized applications.
Real-world analogy
Docker gives you shipping containers; Kubernetes is the port authority that decides which ship each container goes on, reroutes it if a ship sinks, and adds more ships when cargo volume spikes.
Detailed explanation
- You describe the desired state (how many replicas, what image, what resources) in YAML, and Kubernetes continuously works to make reality match that state — this is the reconciliation loop.
- Without it, teams hand-roll scripts to restart crashed containers, balance load across hosts, and roll out new versions — Kubernetes standardizes all of that.
- Core capabilities: self-healing (restarts failed containers), horizontal scaling, service discovery, load balancing, automated rollouts/rollbacks, and secret/config management.
Scenario
A single Docker host running your app goes down at 2 AM. With plain Docker, the app stays down until someone manually restarts it. With Kubernetes, the scheduler notices the pod is missing and reschedules it on a healthy node within seconds — no human involved.
Best practices
- Don't adopt Kubernetes just because it's trendy — a single VM with a supervisor process is fine for low-traffic apps.
- Understand the reconciliation loop deeply before touching production; most 'weird' Kubernetes behavior is this loop doing exactly what it's told.
- Start with managed Kubernetes (EKS/AKS/GKE) rather than self-hosting the control plane.
How does RBAC (Role-Based Access Control) work in Kubernetes?
One-liner
RBAC grants permissions by binding subjects (users, groups, ServiceAccounts) to Roles (namespaced) or ClusterRoles (cluster-wide) that define allowed verbs on specific resources.
Real-world analogy
A Role is a job description listing exactly what tasks (verbs: get, list, create, delete) someone can perform on which equipment (resources: pods, secrets). A RoleBinding is literally handing that job description to a specific employee.
Detailed explanation
- Four objects: Role (namespaced permissions), ClusterRole (cluster-wide or reusable permissions), RoleBinding (grants a Role/ClusterRole within one namespace), ClusterRoleBinding (grants cluster-wide).
- Permissions are additive only — there's no 'deny' rule in RBAC; the effective permission set is the union of every Role/ClusterRole bound to a subject.
- ServiceAccounts are how Pods authenticate to the API server — every Pod runs as some ServiceAccount (default, if not specified), and overly permissive default ServiceAccounts are a classic security gap.
Scenario
A cluster audit finds the default ServiceAccount in a namespace bound to a ClusterRole with cluster-admin permissions, inherited from an early setup script. Any Pod in that namespace — including ones running third-party code — could use that ServiceAccount's token to fully control the cluster. Removing the binding and creating scoped, minimal ServiceAccounts per workload closes the gap.
Best practices
- Never bind cluster-admin to anything except genuine human break-glass access — application ServiceAccounts should get the minimum permissions they need.
- Create a dedicated ServiceAccount per application rather than relying on the default ServiceAccount in a namespace.
- Periodically audit RoleBindings and ClusterRoleBindings — permissions tend to accumulate and rarely get revoked once granted.
Users report intermittent DNS resolution failures for a service from within the cluster. How do you troubleshoot?
One-liner
In-cluster DNS issues are usually caused by CoreDNS resource pressure, a misconfigured NetworkPolicy blocking DNS traffic, or a broken CoreDNS pod — isolate which layer is failing with a targeted debug Pod before changing anything.
Real-world analogy
It's like intermittent trouble getting through to directory assistance at a call center — sometimes the call goes through fine, sometimes it doesn't. You need to find out if the call center itself is understaffed (CoreDNS under-resourced), the phone lines are selectively blocked (NetworkPolicy), or a specific operator is malfunctioning (a bad CoreDNS pod), rather than assuming it's the caller's fault.
Detailed explanation
- Start with a dedicated debug Pod running a DNS query tool (kubectl run -it --rm debug --image=busybox -- nslookup <service>.<namespace>.svc.cluster.local) to reproduce the issue in isolation from application code, which rules out app-level red herrings.
- Check CoreDNS Pod health and resource usage (kubectl get pods -n kube-system -l k8s-app=kube-dns, kubectl top pods -n kube-system) — CoreDNS getting CPU-throttled or OOMKilled under load is a very common cause of intermittent (not constant) DNS failures.
- Check for NetworkPolicies that might be inadvertently blocking egress to CoreDNS's Pod IPs/port (UDP/TCP 53) — a default-deny-egress policy that forgot to explicitly allow DNS traffic is a classic self-inflicted cause.
Scenario
Intermittent DNS failures correlate exactly with traffic spikes. kubectl top pods -n kube-system shows CoreDNS Pods hitting their CPU limit and getting throttled during those spikes, causing some DNS queries to time out. Increasing CoreDNS replica count and CPU limits, combined with enabling its built-in caching more aggressively, resolves the intermittent failures.
Best practices
- Treat CoreDNS as a critical, monitored piece of infrastructure — set its own alerting on error rate, latency, and resource throttling, not just application-level alerts.
- Whenever rolling out default-deny NetworkPolicies, explicitly allow DNS egress (UDP/TCP port 53 to kube-system) in the same change, or you'll break DNS cluster-wide.
- Reproduce with a minimal debug Pod first — this rules out application-level bugs and narrows the investigation to cluster networking/DNS specifically.
A preview of the 82 questions in the Kubernetes guide
Junior (22)
- What is Kubernetes and why do we need it?
- What are Pods, and why doesn't Kubernetes schedule containers directly?
- What is the difference between a Deployment, a ReplicaSet, and a Pod?
- What is a Kubernetes Service and why can't I just use a Pod's IP?
+ 18 more Junior questions, with full answers, in the guide.
Mid-level (20)
- How do resource requests and limits actually affect scheduling and runtime behavior?
- How does the Horizontal Pod Autoscaler (HPA) work end-to-end?
- What is a PodDisruptionBudget and why does it matter during maintenance?
- What's the difference between Node Affinity, Pod Affinity, and Taints/Tolerations?
+ 16 more Mid-level questions, with full answers, in the guide.
Senior (20)
- How would you design a multi-cluster strategy, and what are the tradeoffs between active-active and active-passive approaches?
- How do you approach etcd backup and restore strategy for a production cluster at scale?
- How would you design pod security standards and admission control for a multi-tenant cluster?
- How would you design a GitOps-based deployment architecture for a platform serving many product teams?
+ 16 more Senior questions, with full answers, in the guide.
Scenario (20)
- A Pod is stuck in CrashLoopBackOff. Walk through your debugging process.
- A Deployment's Pods are all stuck in Pending and never get scheduled. How do you investigate?
- Users report intermittent DNS resolution failures for a service from within the cluster. How do you troubleshoot?
- A PersistentVolumeClaim is stuck in Pending status and the Pod using it never starts. How do you diagnose it?
+ 16 more Scenario questions, with full answers, in the guide.
Get the full DevOps / SRE Interview Guide