Kubernetes Interview Questions: Core Concepts to Advanced Orchestration

Reviewed by Mark Dickie · Last updated

Kubernetes is an open-source container orchestration system that automates deploying, scaling, and managing containerized workloads across a cluster of nodes. Interviews cover a wide range, from explaining what a Pod is all the way to debugging a crashlooping workload or tuning a Horizontal Pod Autoscaler. You should be comfortable with the control-plane components, the networking model, workload resource types, and how kubectl surfaces cluster state. Understanding why Kubernetes makes certain design choices — not just the CLI flags — is what separates strong candidates.

What the interview will test

Kubernetes interviews tend to cluster around four themes regardless of company or seniority level:

  1. Core abstractions — Pod, ReplicaSet, Deployment, Service, Namespace, ConfigMap, Secret. Know what each owns and what it delegates.
  2. Scheduling and resource management — how the scheduler selects a node, what node affinity and taints/tolerations do, and why resource requests differ from limits.
  3. Networking — the flat pod-network requirement, how kube-proxy implements Service routing, ClusterIP vs NodePort vs LoadBalancer, and what a NetworkPolicy actually enforces.
  4. Cluster operations — rolling updates, rollback mechanics, RBAC, health probes, and reading events to diagnose failures.

Control-plane components at a glance

Every interviewer asking "walk me through what happens when you run kubectl apply" expects you to name these:

| Component | Runs on | Responsibility | |---|---|---| | kube-apiserver | Control plane | Single entry point for all REST operations; validates and persists to etcd | | etcd | Control plane | Consistent key-value store; source of truth for all cluster state | | kube-scheduler | Control plane | Watches for unbound Pods and assigns them to a node based on constraints and resources | | kube-controller-manager | Control plane | Runs reconciliation loops (Deployment, Node, Endpoint controllers, etc.) | | kubelet | Every node | Pulls the Pod spec and tells the container runtime to start or stop containers | | kube-proxy | Every node | Maintains iptables/IPVS rules that implement Service virtual IPs |

Workload resource types

A common early-round question asks you to pick the right resource for a scenario. The short version:

| Resource | Use when… | |---|---| | Deployment | You need stateless replicas with rolling-update control | | StatefulSet | Pods need stable network IDs and ordered, persistent storage | | DaemonSet | One pod per node (log collector, node exporter, CNI agent) | | Job / CronJob | Run-to-completion or scheduled batch work |

How to approach deeper questions

  1. State the default behaviour first. Interviewers often ask about edge cases; anchoring on the default shows you know the baseline.
  2. Name the relevant API object. "I'd use a PodDisruptionBudget" beats "you can set a policy that limits voluntary disruptions."
  3. Connect config to consequence. For probes, explain what happens to traffic if a readinessProbe fails — the pod is removed from Endpoints, not killed. The distinction matters.
  4. Mention the version context where it counts. The move from PodSecurityPolicy (removed in 1.25) to Pod Security Admission is a live topic; so is the graduation of autoscaling/v2 in 1.26.
  5. Read the events. In practical rounds, kubectl describe pod <name> and kubectl get events --sort-by=.lastTimestamp will surface more signal than logs alone.

A solid answer always ties mechanism to observable behaviour. Know what a correct state looks like, then reason backwards from a broken state to the cause.

At a glance

Questions15
Difficulty2–5 of 5
FormatsMultiple choice, Multiple answer, True / false, Code output, Find the bug

What you'll review

  1. service types
  2. deployments
  3. secrets
  4. probes
  5. statefulsets
  6. resource requests limits
  7. env config
  8. etcd
  9. replica scaling
  10. qos eviction
  11. pods
  12. namespaces
  13. rollback
  14. labels selectors
  15. services

Practice questions

Kubernetes/k8s-networking/service-types

You create a Service and omit the type field entirely. What type does Kubernetes give it?

Options

  • ClusterIP
  • NodePort
  • LoadBalancer
  • ExternalName
Show answer

A Service with no type field defaults to ClusterIP, giving it a stable virtual IP that is reachable only from within the cluster. NodePort and LoadBalancer extend ClusterIP to expose the Service externally, and ExternalName maps the Service to an external DNS name. Omitting type when you wanted external access leaves the Service internal-only.

Why:

ClusterIP is the default: the Service gets a stable virtual IP reachable only from inside the cluster. NodePort and LoadBalancer build on top of it to expose the Service externally, and ExternalName is a special DNS-alias type that points at an out-of-cluster host. If you forget type expecting external reach, your Service is silently internal-only.

Kubernetes/k8s-workloads/deployments

A Deployment keeps a set of identical Pods running. Which object does it create and manage to actually do that?

Options

  • A ReplicaSet, which in turn owns the Pods
  • The Pods directly, with no intermediate object
  • A StatefulSet, one per Pod
  • A DaemonSet that pins one Pod per node
Show answer

A Deployment manages its Pods indirectly through a ReplicaSet: the Deployment owns one or more ReplicaSets, and each ReplicaSet owns the Pods. That indirection is what enables rolling updates — Kubernetes creates a new ReplicaSet for the updated Pod template and scales it up while scaling the old ReplicaSet down. kubectl get rs reveals the ReplicaSets behind a Deployment.

Why:

A Deployment manages Pods indirectly through a ReplicaSet: the Deployment owns ReplicaSets, and each ReplicaSet owns the Pods. This indirection is what makes rolling updates work — a new ReplicaSet is created for the new template and scaled up while the old one scales down. kubectl get rs shows the ReplicaSets behind your Deployments.

Kubernetes/k8s-config/secrets

Out of the box, with no extra cluster configuration, how is the data in a Kubernetes Secret stored in etcd?

Options

  • base64-encoded, but not encrypted
  • AES-encrypted with a cluster key by default
  • Hashed, so the original value can't be read back
  • As plaintext, with no encoding at all
Show answer

By default a Secret's data is only base64-encoded, which is encoding rather than encryption — anyone able to read the Secret or the underlying etcd store can decode it instantly. Encryption at rest is opt-in via an EncryptionConfiguration on the API server. Values aren't hashed, because Kubernetes must deliver the real value to the Pod that consumes it.

Why:

Secret values are only base64-encoded, which is encoding, not encryption — anyone who can read the Secret (or etcd) can trivially decode them. Encryption at rest in etcd is opt-in (an EncryptionConfiguration on the API server). Hashing would be useless because Kubernetes must hand the real value to the Pod. Treating Secrets as 'encrypted by default' is a common and dangerous assumption.

Kubernetes/k8s-health/probes

A container's readiness probe starts failing while the process keeps running. What does Kubernetes do?

Options

  • Removes the Pod from its Services' endpoints so it stops receiving traffic, without restarting it
  • Restarts the container in place
  • Deletes the Pod and reschedules it onto another node
  • Leaves the Pod in Pending until the probe passes
Show answer

A failing readiness probe makes Kubernetes remove the Pod from its Services' endpoint lists, so it stops receiving new traffic — but the container keeps running and is not restarted. Restarting on failure is the liveness probe's role. The separation lets a Pod say 'don't route to me right now' during cache warm-up or transient overload without being killed or rescheduled.

Why:

Readiness controls traffic, not lifecycle: a failing readiness probe takes the Pod out of the Service's endpoint list so no new requests are routed to it, but the container is left running. Restarting on failure is the liveness probe's job. This split lets a Pod signal 'busy / warming up, don't send me traffic' without being killed — useful during cache warm-up or temporary overload.

Kubernetes/k8s-workloads/statefulsets

Which requirement most specifically calls for a StatefulSet instead of a Deployment?

Options

  • Each replica needs a stable network identity and its own durable storage that persists across restarts
  • A stateless web tier that must scale up and down quickly
  • Running exactly one Pod on every node in the cluster
  • Running a batch task that runs once and then exits
Show answer

Choose a StatefulSet when each replica needs a stable, ordinal identity (db-0, db-1), a matching stable DNS name, and its own durable storage that follows it across restarts — the guarantees clustered databases and quorum systems rely on. Stateless tiers belong in a Deployment, one-Pod-per-node workloads in a DaemonSet, and run-to-completion tasks in a Job.

Why:

StatefulSets give each replica a stable, ordinal identity (db-0, db-1), a matching stable DNS name, and a PersistentVolumeClaim that follows that identity across reschedules — exactly what clustered databases and quorum systems need. A stateless tier is a Deployment, one-Pod-per-node is a DaemonSet, and run-to-completion work is a Job. Reaching for a StatefulSet for a stateless app just adds ordering constraints you don't want.

Kubernetes/k8s-scheduling/resource-requests-limits

When deciding whether a Pod fits on a node, which number does the kube-scheduler compare against the node's allocatable capacity?

Options

  • The sum of the containers' resource requests
  • The sum of the containers' resource limits
  • The container's current live CPU/memory usage
  • The average of each container's request and limit
Show answer

The kube-scheduler places a Pod based on the sum of its containers' resource requests, comparing that against each node's unreserved allocatable capacity — actual live usage and limits are not considered at scheduling time. Limits only cap runtime behaviour (CPU throttling, memory OOM kills). Requests set too low overpack nodes; set too high they waste capacity and can leave Pods stuck Pending.

Why:

Scheduling is driven by requests: the scheduler only places a Pod on a node whose unreserved allocatable capacity can cover the Pod's total requests, regardless of actual live usage. Limits cap runtime behaviour (CPU throttling, OOM kills) but are ignored at scheduling time. Setting requests too low overpacks nodes; setting them too high wastes capacity and can leave Pods Pending.

Kubernetes/k8s-config/env-config

A ConfigMap is consumed by a Deployment's Pods as environment variables. You edit the ConfigMap's values. What do the already-running Pods see?

Options

  • Nothing changes — env vars are injected at container start, so the Pods must be restarted to pick up new values
  • The new values immediately, on the next request
  • The new values after the kubelet's next sync (about a minute)
  • An error, because a ConfigMap in use cannot be edited
Show answer

Environment variables are resolved once at container start, so editing a ConfigMap consumed via env vars has no effect on running Pods until they are recreated — for example with kubectl rollout restart deployment. The contrast that confuses people: a ConfigMap mounted as a volume does update in place over time via the kubelet, but the env-var injection path never does.

Why:

Environment variables are resolved once, when the container starts, so editing the ConfigMap has no effect on running Pods until they're recreated (e.g. kubectl rollout restart deployment). This trips people up because a ConfigMap mounted as a volume does get updated in place (eventually, via the kubelet sync) — but the env-var path never does. If config must change live, mount it as a file and watch it, or roll the Deployment.

Kubernetes/k8s-architecture/etcd

Where does a Kubernetes cluster persist the authoritative state of every object (Deployments, Pods, Secrets, …)?

Options

  • In etcd, the cluster's key-value store
  • In a SQL database embedded in the kube-apiserver
  • In memory in the kube-scheduler
  • In a local file on each node's kubelet
Show answer

Kubernetes persists the authoritative state of every object in etcd, a consistent distributed key-value store. The kube-apiserver is the only component that reads from and writes to etcd directly; every other component goes through the API server. Consequently an etcd backup is effectively a full cluster backup, and losing etcd without one means losing the cluster's desired state.

Why:

etcd is the single source of truth: a consistent, distributed key-value store that holds all cluster state. The kube-apiserver is the only component that talks to etcd directly; everything else reads and writes through the API server. This is why an etcd backup is a cluster backup, and why losing etcd without a backup means losing the cluster's desired state.

Kubernetes/k8s-scaling/replica-scaling

A Deployment is set to replicas: 3 and currently has 3 running Pods. Select all events after which Kubernetes will automatically bring the running count back to 3.

Options

  • You delete one of the Pods with kubectl delete pod
  • The node running one Pod becomes NotReady and is drained
  • You run kubectl scale deployment --replicas=1
  • One Pod's process crashes and its container restarts in place
Show answer

A Deployment's ReplicaSet reconciles the actual Pod count toward the desired count, so it recreates Pods after a manual kubectl delete pod or after a node is drained — both drop the count below the target. Scaling to 1 changes the desired state itself, so nothing is recreated, and an in-place container restart never lowered the Pod count. The key distinction is desired-state changes versus actual-state drift.

Why:

The ReplicaSet continuously reconciles actual Pods toward the desired count. Manually deleting a Pod (a) or losing a Pod when its node is drained (b) both drop the count below 3, so the controller creates replacements. Scaling to 1 (c) changes the desired state — 1 Pod is now correct, nothing is recreated. An in-place container restart (d) never reduced the Pod count, so there's nothing to recreate. The distinction between 'desired state changed' and 'actual state drifted' is the core of how controllers behave.

Kubernetes/k8s-scheduling/qos-eviction

Under node memory pressure, Kubernetes evicts Guaranteed-QoS Pods last. What must be true of a Pod for it to receive the Guaranteed QoS class? Select all that apply.

Options

  • Every container sets both a memory request and a memory limit
  • Every container sets both a CPU request and a CPU limit
  • For each container, the request equals the limit for that resource
  • The Pod sets priorityClassName: system-cluster-critical
Show answer

A Pod gets the Guaranteed QoS class only when every container sets both a request and a limit for CPU and for memory, and the request equals the limit for each resource. Any gap drops it to Burstable or BestEffort, which are evicted earlier under node memory pressure. PriorityClass is a separate mechanism that also affects eviction order but does not determine QoS class.

Why:

Guaranteed requires every container to specify CPU and memory requests and limits, with request equal to limit for each resource. Miss any of those and the Pod is Burstable (some requests/limits set) or BestEffort (none) — both evicted earlier under node pressure. Priority (d) is a separate mechanism: it influences preemption and eviction ordering too, but it does not determine the QoS class. Conflating QoS with PriorityClass is a classic senior-level trap.

Kubernetes/k8s-workloads/pods

A Pod can contain more than one container, and containers in the same Pod share a network namespace, so they can reach each other over localhost.

Show answer

True. A Pod is the smallest deployable unit and can hold multiple containers — the sidecar pattern. Containers in one Pod share its network namespace and IP address, so they reach each other over localhost on different ports, and they can share mounted volumes. They do not share a filesystem by default, which is why a proxy or logging sidecar can talk to the main container with no Service in between.

Why:

A Pod is the smallest deployable unit and may hold multiple containers (the sidecar pattern). They share the Pod's network namespace and IP, so they communicate over localhost on different ports, and they can share volumes. They do not share a filesystem by default. This is why a logging or proxy sidecar can talk to the main container without any Service in between.

Kubernetes/k8s-workloads/namespaces

Putting workloads in separate Namespaces stops Pods in one Namespace from reaching Pods in another over the network by default.

Show answer

False. Namespaces are a logical scope for names, RBAC, and resource quotas — not a network boundary. By default the cluster network is flat, so any Pod can reach any other Pod's IP regardless of Namespace. Restricting cross-Namespace traffic requires NetworkPolicies enforced by a capable CNI. Treating Namespaces as network isolation is a frequent cause of accidental exposure between teams or environments.

Why:

False — Namespaces are a logical scope (for names, RBAC, and quotas), not a network boundary. By default any Pod can reach any other Pod's IP across Namespaces; the flat cluster network is wide open. To actually restrict cross-Namespace traffic you apply NetworkPolicies (and your CNI must enforce them). Believing Namespaces isolate traffic is a common source of accidental exposure between teams or environments.

Kubernetes/k8s-rollouts/rollback

kubectl rollout undo deployment/web can revert to the previous version because Kubernetes retains the old ReplicaSets as revision history.

Show answer

True. Every Deployment update creates a new ReplicaSet and retains prior ones (up to revisionHistoryLimit, default 10) scaled to zero. kubectl rollout undo scales a previous ReplicaSet back up and the current one down — a fast rollback with no image rebuild. Setting revisionHistoryLimit: 0 discards that history, leaving undo nothing to revert to, which is a common self-inflicted trap.

Why:

True. Each Deployment update creates a new ReplicaSet and keeps prior ones (up to revisionHistoryLimit, default 10) scaled to zero. rollout undo simply scales a previous ReplicaSet back up and the current one down — a fast rollback with no rebuild. If you set revisionHistoryLimit: 0, that history is discarded and undo has nothing to roll back to, which is a trap people hit when trimming clutter.

Kubernetes/k8s-operations/labels-selectors

These three Pods exist, and a Service uses the selector shown. How many Pods does the Service include in its endpoints?

# Running Pods and their labels:
#   web-1    app=web, env=prod
#   web-2    app=web, env=dev
#   web-3    app=web, env=prod

# Service:
spec:
  selector:
    app: web
    env: prod

Options

  • 2 (web-1 and web-3)
  • 3 (all Pods with app=web)
  • 1 (only the first match)
  • 0 (a selector can only match one label)
Show answer
2 (web-1 and web-3)
Why:

A label selector with multiple keys is a logical AND: a Pod must match every key/value to be selected. Only web-1 and web-3 have both app=web and env=prod; web-2 is excluded by env=dev. People often read it as OR (and expect 3) or assume one label per selector. This AND semantics is also why a Deployment whose selector doesn't fully match its template labels manages nothing.

Kubernetes/k8s-networking/services

The Pods are healthy and the Service has endpoints, but requests to the Service time out. The container listens on port 3000. What's wrong?

apiVersion: v1
kind: Service
metadata:
  name: api
spec:
  selector:
    app: api
  ports:
    - port: 80
      targetPort: 8080

Options

  • targetPort: 8080 doesn't match the container's listening port (3000), so traffic is forwarded to a closed port
  • port: 80 is reserved and can't be used by a Service
  • A Service must omit targetPort and always reuse port
  • The Service is missing type: ClusterIP, so it has no IP
Show answer

targetPort: 8080 doesn't match the container's listening port (3000), so traffic is forwarded to a closed port

Why:

port is the port the Service listens on; targetPort is the container port it forwards to. Here clients hit :80, which the Service forwards to :8080 on each Pod — but the app listens on :3000, so connections are refused/time out. Fix targetPort to 3000 (or name the container port and reference it). type defaults to ClusterIP, port: 80 is allowed, and targetPort defaults to port only when omitted. Endpoints existing but traffic failing is the tell that it's a port mapping, not a selector, problem.

Related interview questions

Job market

See kubernetes salaries and hiring demand from live job postings.

Practice this for real

CodePrep turns your target job description into an adaptive quiz from a bank of tagged questions, scores your answers, and resurfaces the topics you miss.

New topics and job-market signal, in your inbox

Occasional updates — new question topics, launch news, and what the developer job market is hiring for. Confirm your email to join, and unsubscribe anytime.