Kubernetes is the standard platform for running containers in production. These Kubernetes interview questions cover pods, deployments and services for freshers, then architecture, ConfigMaps and Secrets, probes, autoscaling, ingress, storage, Helm, security and troubleshooting for experienced DevOps engineers.
30 questions · Updated
Reading answers is not the same as saying them.Practise Kubernetes questions out loud and get a score, what you missed and a model answer for each one.
Practise free with AIKubernetes Interview Questions: 30 questions with model answers on this page.
Basic Kubernetes interview questions
Fundamentals, definitions and simple scenarios. Good for freshers and warm-ups.
1. What is Kubernetes, and why use it?
Kubernetes (K8s) is an open-source platform that automates deploying, scaling and managing containerised applications across a cluster of machines. It handles scheduling, self-healing by restarting failed containers, rolling updates and rollbacks, service discovery, load balancing and autoscaling, so teams can run many services reliably.
2. What is a pod?
Answer flow · 4 steps
1
A pod is the smallest deployable unit in Kubernetes.
2
It contains one or more containers that share the same network namespace (IP address and ports) and storage volumes and are scheduled together on one node.
3
Usually a pod runs one main container, sometimes with sidecar containers for logging or proxies.
4
Pods are temporary and replaced rather than repaired.
3. What is the difference between a Deployment, a StatefulSet and a DaemonSet?
Answer flow · 3 steps
1
A Deployment manages stateless pods through ReplicaSets, with rolling updates and rollbacks.
2
A StatefulSet gives pods stable names, ordered startup and their own persistent storage, which suits databases and Kafka.
3
A DaemonSet runs one pod on every node (or selected nodes), which suits log collectors and monitoring agents.
4. Which kubectl commands do you use most?
kubectl get pods (and deployments, services, nodes), kubectl describe pod name for details and events, kubectl logs name (-f to follow, --previous for a crashed container), kubectl exec -it name -- sh, kubectl apply -f file.yaml to create or update resources, kubectl delete, kubectl rollout status and undo, kubectl port-forward for local access and kubectl top for resource use.
5. What are namespaces?
Answer flow · 3 steps
1
Namespaces divide one cluster into virtual groups, for example per team or environment such as dev and staging.
2
Resource names must be unique within a namespace, and RBAC rules, resource quotas and network policies can be applied per namespace.
3
Some resources, such as nodes and persistent volumes, are cluster-wide. kubectl -n name targets a namespace.
6. What are labels and selectors?
Answer flow · 4 steps
1
Labels are key-value pairs attached to objects, such as app: checkout and env: prod.
2
Selectors find objects by their labels: a Service sends traffic to pods matching its selector, and a Deployment manages pods matching its selector.
3
Labels are also used for filtering with kubectl get pods -l app=checkout.
4
Annotations store non-identifying metadata.
7. What is a ReplicaSet?
A ReplicaSet makes sure a specified number of identical pods is running at all times, creating new pods if some fail or are deleted. You rarely create ReplicaSets directly; a Deployment manages them, creating a new ReplicaSet for each new version during rolling updates and keeping old ones for rollback.
8. What are Jobs and CronJobs?
Answer flow · 3 steps
1
A Job runs pods until a task completes successfully, such as a database migration or a batch import, with settings for retries, parallelism and completions.
2
A CronJob creates Jobs on a schedule using cron syntax, such as nightly reports or cleanup.
3
Settings such as concurrencyPolicy and startingDeadlineSeconds control overlapping and missed runs.
9. What are resource requests and limits?
Answer flow · 3 steps
1
A request is the CPU and memory a container is guaranteed; the scheduler uses requests to decide which node has room.
2
A limit is the maximum it may use: exceeding the CPU limit causes throttling, and exceeding the memory limit kills the container (OOMKilled).
3
Setting realistic requests is essential for stable scheduling and autoscaling.
10. How do you roll out a new version and roll back?
Update the image in the Deployment, with kubectl apply or kubectl set image, and Kubernetes performs a rolling update, replacing pods gradually based on maxSurge and maxUnavailable while readiness probes confirm new pods are ready. kubectl rollout status watches progress, kubectl rollout history lists revisions, and kubectl rollout undo returns to the previous version.
11. What is the structure of a Kubernetes YAML manifest?
Answer flow · 3 steps
1
Every manifest has apiVersion (such as apps/v1), kind (such as Deployment), metadata (name, namespace, labels and annotations) and spec, which describes the desired state, such as replicas, the pod template, containers, images, ports and environment variables.
2
Kubernetes adds a status section showing the actual state.
3
Several resources can be in one file separated by ---.
Intermediate Kubernetes interview questions
Applied problems, trade-offs and questions about your own projects.
12. What are the types of Kubernetes Services?
Answer flow · 3 steps
1
A Service gives a stable IP and DNS name to a set of pods selected by labels.
2
ClusterIP (default) exposes it only inside the cluster, NodePort exposes it on a port on every node, LoadBalancer provisions a cloud load balancer, and ExternalName maps to an external DNS name.
3
Headless services give direct pod DNS records for StatefulSets.
13. What is the difference between ConfigMaps and Secrets?
Answer flow · 3 steps
1
Both inject configuration into pods as environment variables or mounted files.
2
ConfigMaps hold non-sensitive configuration.
3
Secrets hold sensitive data such as passwords and tokens; they are only base64-encoded by default, so encryption at rest, strict RBAC, and often an external secrets manager such as Vault or AWS Secrets Manager are needed.
14. What are liveness, readiness and startup probes?
Answer flow · 4 steps
1
A liveness probe checks whether the container is healthy; if it fails, Kubernetes restarts the container.
2
A readiness probe checks whether the container can serve traffic; if it fails, the pod is removed from Service endpoints but not restarted.
3
A startup probe gives slow-starting apps time before the other probes begin.
4
Badly configured probes can cause restart loops.
15. What is an Ingress?
Answer flow · 3 steps
1
An Ingress defines HTTP and HTTPS routing rules from outside the cluster to Services, based on hostnames and paths, with TLS termination.
2
It needs an ingress controller such as NGINX Ingress or a cloud load balancer controller to work.
3
The newer Gateway API is the more expressive successor.
16. What are PersistentVolumes, PersistentVolumeClaims and StorageClasses?
Answer flow · 4 steps
1
A PersistentVolume is a piece of storage in the cluster, such as a cloud disk.
2
A PersistentVolumeClaim is a pod's request for storage of a certain size and access mode.
3
A StorageClass describes a type of storage, such as fast SSD, and lets claims create volumes dynamically.
4
Data survives pod restarts, and StatefulSets create one claim per pod.
17. What is Helm?
Answer flow · 3 steps
1
Helm is a package manager for Kubernetes.
2
A chart is a package of templated manifests with default values in values.yaml, which can be overridden per environment. helm install, upgrade and rollback manage releases, and public charts make it easy to install software such as ingress controllers, Prometheus and databases.
3
Kustomize is a template-free alternative using overlays.
18. What are taints, tolerations and node affinity?
Answer flow · 3 steps
1
A taint on a node repels pods, unless a pod has a matching toleration, which is used to reserve nodes for special workloads such as GPU jobs.
2
Node affinity attracts pods to nodes with certain labels, such as a zone or instance type, as a requirement or a preference.
3
Pod affinity and anti-affinity place pods near or away from other pods, for example spreading replicas across zones.
19. What is a PodDisruptionBudget?
Answer flow · 3 steps
1
A PodDisruptionBudget limits how many pods of an application can be down at once during voluntary disruptions, such as node upgrades or cluster scaling down, with minAvailable or maxUnavailable.
2
It keeps enough replicas serving traffic while nodes are drained.
3
It does not protect against involuntary failures such as a node crashing.
20. How does RBAC work in Kubernetes?
Answer flow · 3 steps
1
Role-based access control grants permissions with Roles (within one namespace) and ClusterRoles (cluster-wide), which list allowed verbs such as get, list, create and delete on resources.
2
RoleBindings and ClusterRoleBindings give those permissions to users, groups or service accounts.
3
Pods use service accounts to talk to the API, and each should have the least privilege it needs.
21. What are NetworkPolicies?
Answer flow · 4 steps
1
By default, every pod can talk to every other pod.
2
NetworkPolicies act as firewall rules that allow only certain traffic, selecting pods by labels and allowing ingress or egress from specific pods, namespaces or IP ranges.
3
A common pattern is a default-deny policy followed by explicit allow rules.
4
They need a network plugin that supports them, such as Calico or Cilium.
22. What are init containers and sidecar containers?
Init containers run to completion, one after another, before the main containers start, for tasks such as waiting for a database, running migrations or downloading configuration. Sidecar containers run alongside the main container for its whole life, providing helpers such as log shipping, proxies or certificate renewal; Kubernetes now supports native sidecars as init containers with restartPolicy: Always.
High level Kubernetes interview questions
System design, deep internals, leadership and tough follow-ups.
23. Explain the Kubernetes architecture.
The control plane includes the API server (the entry point for all operations), etcd (the key-value store holding cluster state), the scheduler (assigns pods to nodes) and the controller manager (runs control loops that move actual state towards desired state). Each worker node runs the kubelet (manages pods on the node), a container runtime such as containerd, and kube-proxy (handles Service networking).
24. How does autoscaling work in Kubernetes?
Answer flow · 5 steps
1
The Horizontal Pod Autoscaler adds or removes pod replicas based on CPU, memory or custom metrics.
2
The Vertical Pod Autoscaler adjusts the resource requests of pods.
3
The Cluster Autoscaler or Karpenter adds nodes when pods cannot be scheduled and removes idle ones.
4
KEDA scales on events such as queue length.
5
Accurate resource requests are essential for all of them.
25. A pod is stuck in CrashLoopBackOff. How do you troubleshoot it?
Answer flow · 3 steps
1
I run kubectl describe pod to see events and the last state, and kubectl logs --previous to see the logs from the crashed container.
2
Common causes are application errors, missing ConfigMaps or Secrets, wrong environment variables, a failing liveness probe, the wrong command, or being OOMKilled because the memory limit is too low.
3
I fix the cause and redeploy, and use kubectl exec or a debug container if needed.
26. How do you implement blue-green and canary deployments?
Answer flow · 3 steps
1
Blue-green runs the new version beside the old one and switches all traffic at once, by changing a Service selector or ingress, with instant rollback.
2
Canary sends a small percentage of traffic to the new version first and increases it while metrics stay healthy.
3
Tools such as Argo Rollouts and Flagger automate canaries using ingress controllers or a service mesh and analyse metrics to promote or roll back.
27. What is GitOps?
Answer flow · 3 steps
1
GitOps uses a Git repository as the single source of truth for the desired state of the cluster.
2
A controller such as Argo CD or Flux runs inside the cluster, compares the live state with Git and applies changes automatically, reverting manual drift.
3
Deployments happen through pull requests, which gives review, history, easy rollback and no need for CI to hold cluster credentials.
28. What is a service mesh?
A service mesh such as Istio or Linkerd adds a layer, using sidecar proxies or an ambient node-level design, that handles service-to-service traffic: mutual TLS encryption and identity, retries, timeouts, traffic splitting for canaries, and detailed metrics and tracing, without changing application code. It adds complexity and resource overhead, so it suits larger microservice systems.
29. What are Operators and Custom Resource Definitions?
Answer flow · 3 steps
1
A Custom Resource Definition adds a new resource type to the Kubernetes API, such as PostgresCluster or Certificate.
2
An Operator is a controller that watches those resources and automates operational knowledge, such as provisioning a database cluster, taking backups, handling failover and upgrades, the way a human operator would.
3
Examples include cert-manager and database operators.
30. How do you secure a Kubernetes cluster?
Keep the control plane private and up to date, use RBAC with least privilege, enforce Pod Security Standards so pods run as non-root without privileged access, apply NetworkPolicies, encrypt secrets at rest or use an external secrets manager, scan and sign images and allow only trusted registries with admission policies (Kyverno or OPA Gatekeeper), enable audit logs and runtime threat detection such as Falco.
Ready to test yourself?Pick your topics and level, answer by voice or text, and get instant feedback. Free.