Skip to content
TryHired.
Interview prep · Technical

Kubernetes interview questions: answers with example manifests

Pods to RBAC, explained in plain words with the manifests and kubectl commands interviewers expect you to read.

Updated Nov 12, 2026 · Examples are configuration and formulas, not executed · questions: TryHired
Quick answer

Kubernetes interviews start with the building blocks (pods, Deployments, Services, namespaces, ConfigMaps and Secrets), then move to running workloads well (probes, resource requests and limits, rolling updates, autoscaling, storage) and finally to how the cluster works and how you debug it (control plane, RBAC, network policies, CrashLoopBackOff). Below are 20 questions from basic to advanced, each with a short answer and, where it helps, an example manifest or command.

Basic

Basic kubernetes interview questions

Advice

Basic1. What is Kubernetes, and what problem does it solve?

Kubernetes is an open-source system for running containers across a cluster of machines. You declare the state you want (which containers, how many copies, how they are exposed) and Kubernetes keeps reality matching it: it schedules containers onto nodes, restarts failed ones, scales them, gives them stable network names and rolls out new versions.

Basic2. What is the difference between a pod and a container?

A pod is the smallest unit Kubernetes schedules. It wraps one or more containers that always run together on the same node, share one network address and can share storage volumes. Most pods run a single application container, sometimes with a helper (sidecar) container.

Basic3. What does a Deployment do?

A Deployment manages a set of identical pods through a ReplicaSet. You declare how many replicas you want and which image to run; the Deployment creates or replaces pods to match, performs rolling updates when you change the template, and keeps a history so you can roll back.

YAML · Example (not executed)
apiVersion: apps/v1
kind: Deployment
metadata:
  name: web
spec:
  replicas: 3
  selector:
    matchLabels:
      app: web
  template:
    metadata:
      labels:
        app: web
    spec:
      containers:
        - name: web
          image: nginx:1.27
          ports:
            - containerPort: 80

Basic4. What is a Service, and what are its types?

A Service gives a changing set of pods one stable name and virtual IP, and load-balances traffic across the pods its selector matches. ClusterIP (the default) is reachable only inside the cluster; NodePort opens a port on every node; LoadBalancer asks the cloud provider for an external load balancer; ExternalName maps the Service to an outside DNS name.

YAML · Example (not executed)
apiVersion: v1
kind: Service
metadata:
  name: web
spec:
  type: ClusterIP
  selector:
    app: web
  ports:
    - port: 80
      targetPort: 80

Basic5. What are namespaces used for?

Namespaces divide one cluster into separate spaces for names, access control and resource quotas, for example one per team or environment. Names must be unique within a namespace, not across the cluster. Clusters start with namespaces such as default and kube-system. Some objects, such as nodes and PersistentVolumes, are not namespaced.

Basic6. What is the difference between a ConfigMap and a Secret?

Both inject configuration into pods as environment variables or files. ConfigMaps hold non-sensitive settings. Secrets hold sensitive values such as passwords and tokens; by default they are only base64-encoded, not encrypted, so production clusters should enable encryption at rest and restrict who can read Secrets with RBAC.

Basic7. Which kubectl commands do you use every day?

get lists objects, describe shows details and recent events, logs prints container output, apply creates or updates objects from a file, exec runs a command inside a container, and rollout manages Deployment updates.

Shell · Example (not executed)
kubectl get pods -n shop
kubectl describe pod web-7d9f8c6b5-x2kq4 -n shop
kubectl logs deploy/web -n shop --tail=50
kubectl apply -f deployment.yaml
kubectl exec -it web-7d9f8c6b5-x2kq4 -n shop -- sh
kubectl rollout status deploy/web -n shop
Intermediate

Intermediate kubernetes interview questions

Advice

Intermediate8. What is the difference between liveness, readiness and startup probes?

A liveness probe tells the kubelet when to restart a container that is stuck. A readiness probe tells Kubernetes when a pod can receive traffic; a failing pod is removed from Service endpoints but not restarted. A startup probe protects slow-starting apps: liveness and readiness checks wait until it succeeds.

YAML · Example (not executed)
containers:
  - name: api
    image: example/api:2.4.1
    startupProbe:
      httpGet: {path: /healthz, port: 8080}
      failureThreshold: 30
      periodSeconds: 5
    readinessProbe:
      httpGet: {path: /ready, port: 8080}
      periodSeconds: 10
    livenessProbe:
      httpGet: {path: /healthz, port: 8080}
      periodSeconds: 10

Intermediate9. What are resource requests and limits?

A request is what the scheduler reserves for a container when it places the pod on a node. A limit is the ceiling at runtime: a container that goes over its CPU limit is throttled, while one that goes over its memory limit is killed (OOMKilled) and may be restarted. Setting requests well is what makes scheduling and autoscaling work.

YAML · Example (not executed)
resources:
  requests:
    cpu: 250m
    memory: 256Mi
  limits:
    cpu: "1"
    memory: 512Mi

Intermediate10. How does a rolling update work, and how do you roll back?

When the pod template changes, the Deployment creates a new ReplicaSet and shifts pods from old to new gradually. maxSurge controls how many extra pods may exist during the update and maxUnavailable how many may be missing. Readiness probes gate each step. kubectl rollout undo returns to the previous revision.

Shell · Example (not executed)
kubectl set image deploy/web web=nginx:1.27.1
kubectl rollout status deploy/web
kubectl rollout history deploy/web
kubectl rollout undo deploy/web

Intermediate11. When would you use a StatefulSet instead of a Deployment?

Use a StatefulSet for workloads that need a stable identity: each pod gets a fixed ordinal name (db-0, db-1), a stable network name through a headless Service, and its own PersistentVolumeClaim that follows it across restarts. Pods are created and removed in order. Databases and clustered systems such as Kafka are typical uses.

Intermediate12. What are DaemonSets, Jobs and CronJobs?

A DaemonSet runs one copy of a pod on every node (or every matching node), which suits log shippers and monitoring agents. A Job runs pods until a task completes successfully. A CronJob creates Jobs on a schedule written in cron syntax.

Intermediate13. What is an Ingress?

An Ingress defines HTTP and HTTPS routing rules (hostnames and paths) from outside the cluster to Services, often with TLS. It does nothing on its own: an ingress controller such as ingress-nginx or a cloud load balancer controller implements it. The newer Gateway API covers the same need with more expressive, role-oriented objects.

Intermediate14. How do PersistentVolumes, PersistentVolumeClaims and StorageClasses fit together?

A PersistentVolumeClaim is a pod's request for storage of a size and access mode. A PersistentVolume is the actual piece of storage that satisfies it. A StorageClass describes a type of storage and lets Kubernetes create volumes on demand (dynamic provisioning) when a claim names it.

Intermediate15. How does the Horizontal Pod Autoscaler work?

The HPA changes a Deployment's replica count to keep a metric near a target, such as CPU utilization relative to the pods' requests. It needs a metrics source (metrics-server for CPU and memory, or a custom metrics adapter). It adds pods when the metric is above target and removes them, more cautiously, when it is below.

YAML · Example (not executed)
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: web
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: web
  minReplicas: 2
  maxReplicas: 10
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 70
Advanced

Advanced kubernetes interview questions

Advice

Advanced16. What are the components of the control plane and of a node?

The control plane runs kube-apiserver (the front door every client and component talks to), etcd (the key-value store holding cluster state), kube-scheduler (places pods on nodes) and kube-controller-manager (runs the reconciliation loops), plus cloud-controller-manager on cloud clusters. Each node runs the kubelet (starts and watches pods), a container runtime such as containerd, and usually kube-proxy (implements Service networking).

Advanced17. A pod is in CrashLoopBackOff. How do you debug it?

The container keeps starting and exiting, and Kubernetes is waiting longer between restarts. Check the events and exit code with describe, read the logs of the previous crashed run, then look at the usual causes: a bad command or missing config, a failing liveness probe, an OOMKilled container, or a dependency that is not reachable.

Shell · Example (not executed)
kubectl describe pod api-5c7d9b8f4-q8w2n
kubectl logs api-5c7d9b8f4-q8w2n --previous
kubectl get events --sort-by=.lastTimestamp
kubectl get pod api-5c7d9b8f4-q8w2n -o jsonpath='{.status.containerStatuses[0].lastState}'

Advanced18. How does RBAC work in Kubernetes?

A Role (namespaced) or ClusterRole (cluster-wide) lists allowed verbs on resources, such as get and list on pods. A RoleBinding or ClusterRoleBinding grants that role to users, groups or ServiceAccounts. Pods authenticate as their ServiceAccount, so each workload should get its own account with only the permissions it needs.

YAML · Example (not executed)
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: pod-reader
  namespace: shop
rules:
  - apiGroups: [""]
    resources: ["pods"]
    verbs: ["get", "list", "watch"]

Advanced19. What does a NetworkPolicy do?

By default every pod can talk to every other pod. A NetworkPolicy selects pods and allows only the listed ingress and egress traffic, for example only the frontend may reach the API on port 8080. It is enforced only if the cluster's network plugin (CNI) supports network policies.

Advanced20. What is the difference between taints and tolerations and node affinity?

Taints repel: a tainted node accepts only pods that tolerate the taint, which keeps general workloads off special nodes such as GPU machines. Node affinity attracts: it tells the scheduler which nodes a pod must or should run on, based on node labels. They are often combined to dedicate nodes to one workload.

Practice

How to practice with this page

Advice
  • Run a local cluster (kind, minikube or k3d) and apply each manifest yourself.
  • For every object, be ready to say what controller manages it and what happens when a pod dies.
  • Practice reading kubectl describe output and events, not only writing YAML.
  • Explain one real incident you debugged: symptom, cause, fix.
Next

Related interview prep

Disclosure: TryHired makes HIRED, a paid job-search program, so we have a conflict of interest when we mention it. This question bank is free, with no TryHired signup.

FAQ

Questions people ask

What Kubernetes questions are asked in interviews?
Common topics are pods, Deployments, Services, ConfigMaps and Secrets, probes, requests and limits, rolling updates, StatefulSets, Ingress, autoscaling, RBAC and debugging failing pods. Senior roles add cluster architecture, networking and security.
Do I need to write YAML from memory in a Kubernetes interview?
Usually not perfectly, but you should be able to sketch a Deployment and Service and read an unfamiliar manifest. kubectl explain and the documentation are what you would use on the job.
How do I practice Kubernetes for an interview?
Run a local cluster with kind or minikube, deploy a small app with a Deployment, Service and Ingress, then break it on purpose and fix it.
Is Kubernetes the same as Docker?
No. Docker builds and runs containers; Kubernetes orchestrates containers across many machines. Kubernetes runs containers built with Docker through a container runtime such as containerd.
Which Kubernetes certification helps for interviews?
The CNCF's CKA (administrator) and CKAD (application developer) are hands-on exams that cover much of what interviews test.
Method

How this page is built

TryHired wrote these questions and answers. Blocks marked Example (not executed) are configuration, commands or formulas that cannot run on the build machine: no output is claimed for them. The question list is general practice: it does not predict what a particular employer will ask.

What this page can't tell you
  • Interviewers ask different questions for different roles and levels.
  • Answers are short explanations, not complete references.
  • Managed services (EKS, GKE, AKS) add their own features and defaults.
Sources
  1. Kubernetes documentation, concepts: https://kubernetes.io/docs/concepts/
  2. Kubernetes documentation, configure liveness, readiness and startup probes: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
  3. Kubernetes documentation, resource management for pods and containers: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
  4. Kubernetes documentation, using RBAC authorization: https://kubernetes.io/docs/reference/access-authn-authz/rbac/