DevOps.Academy
CoursesCurriculumInterview prepPricing
◔My learningSign in
DevOps.Academy

Free, hands-on DevOps lessons. Made with care in India.

System status

Learn

All coursesLinux roadmapCurriculumInterview questionsCheat sheetsMy learning

Academy

PricingCertificates

Legal

PrivacyTermsContact

devops.rajeev.pro

Kubernetes & Helm · interview practice

Kubernetes & Helm interview questions

Answer each one out loud first, then tap it to check yourself against a model answer and the lesson behind it.

Introduction 4Containers refresher 2Setting up 2Running applications 2Services & networking 3Configuration 2Resource management 2Security 3Monitoring & logging 2Autoscaling 2Scheduling 2Storage 2Helm 2Deployment patterns 3Advanced topics 3

Introduction

Q1What does "desired state" mean in Kubernetes, and what keeps it true?junior

You declare what you want, such as three replicas of an image, and the API server stores it in etcd. Controllers then loop forever: compare what is running with what was declared and fix the difference, so a crashed Pod is replaced without anyone running a restart command.

Read the lesson: Kubernetes: what it solves, and when you don't need it →
Q2A worker node dies. Why does it take minutes, not seconds, for its Pods to come back elsewhere?mid

Kubernetes first has to be sure the node is really gone. In the course lab the node went NotReady at 16 seconds, AWS confirmed the instance was gone at 78 seconds, and every Pod was Running again at 142 seconds. If the node is only unreachable, Pods wait out a default 300-second toleration before eviction, which is why production apps run at least two replicas across nodes.

Read the lesson: Kubernetes: what it solves, and when you don't need it →
Q3Walk me through what happens after kubectl apply of a Deployment.mid

The API server validates the object and stores it in etcd. The Deployment controller creates a ReplicaSet for that Pod template, the ReplicaSet controller creates the Pod objects, the scheduler assigns each one a node, and the kubelet on that node starts the containers. The ReplicaSet keeps the count right; the Deployment manages versions by creating a new ReplicaSet per template change.

Read the lesson: Kubernetes: what it solves, and when you don't need it →
Q4A small team with one web app and one database asks you to set up Kubernetes. What do you tell them?senior

Usually not yet. One VM with Docker Compose, ECS with Fargate, or a PaaS gets them running with far less to operate and learn. Kubernetes earns its cost with many services, several teams, real scaling needs or a multi-cloud requirement, and even then I'd use a managed control plane such as EKS.

Read the lesson: Kubernetes: what it solves, and when you don't need it →

Containers refresher

Q5Why should a Kubernetes manifest name shop-web:v2 rather than shop-web:latest?junior

With latest, two nodes that pulled at different times can run different code under the same name, and "roll back to the previous version" means nothing. A fixed tag, a version or the Git commit SHA that is never reused, makes every node run the same image and gives a rollback a real target.

Read the lesson: Images and registries for Kubernetes →
Q6How do EKS nodes pull from a private ECR repository without a password, and what do you do for other registries?mid

The node group's IAM role carries AmazonEC2ContainerRegistryReadOnly, so the kubelet pulls from ECR in the same account with nothing stored in the cluster. For GitHub Container Registry or a private Docker Hub repo, I create a Secret of type kubernetes.io/dockerconfigjson and reference it as imagePullSecrets in the Pod spec.

Read the lesson: Images and registries for Kubernetes →

Setting up

Q7When would you use kind instead of EKS?junior

kind runs a whole cluster in Docker containers on a laptop in about a minute, for free, which is ideal for learning and CI tests. It cannot create cloud load balancers or real EBS disks, so anything that depends on those, or on adding nodes automatically, needs a managed cluster.

Read the lesson: Setting up: a cluster, kubectl and your first deployment →
Q8How does kubectl authenticate to an EKS cluster?mid

aws eks update-kubeconfig writes the cluster endpoint into ~/.kube/config with an exec plugin that runs aws eks get-token using your AWS identity. The cluster then maps that IAM principal to Kubernetes permissions through an access entry; IAM proves who you are, RBAC decides what you may do.

Read the lesson: Setting up: a cluster, kubectl and your first deployment →

Running applications

Q9What is the difference between a readiness probe and a liveness probe?junior

A failing readiness probe removes the Pod from Service endpoints but leaves it running, which is right for an app that is still warming up. A failing liveness probe makes the kubelet restart the container, which is right for a stuck process; pointing both at a slow dependency can cause needless restarts.

Read the lesson: Running applications: Pods, Deployments, Jobs →
Q10When do you choose a Job, a StatefulSet or a Deployment?mid

A Deployment is for stateless, interchangeable Pods and restarts any container that exits. A Job runs work to a number of successful completions and stops, with a CronJob creating Jobs on a schedule. A StatefulSet gives each Pod a stable name, its own disk and ordered startup, for databases and clustered systems, although a managed service like RDS is often simpler.

Read the lesson: Running applications: Pods, Deployments, Jobs →

Services & networking

Q11Why put a Service in front of Pods instead of calling Pod IPs?junior

Pods are replaced constantly and get a new IP each time. A Service gives one stable virtual IP and DNS name, finds its Pods by label selector, and its EndpointSlice lists only the ready ones. Callers use shop-web or shop-web.default.svc.cluster.local and never track IPs.

Read the lesson: Services, Ingress and load balancing →
Q12When would you use a LoadBalancer Service versus an Ingress on EKS?mid

With the AWS Load Balancer Controller, a LoadBalancer Service becomes one NLB per Service at layer 4. An Ingress becomes an ALB that routes HTTP by host and path to many Services behind one load balancer. For web apps I prefer the Ingress, or Gateway API on new projects, because it saves a load balancer per Service.

Read the lesson: Services, Ingress and load balancing →
Q13Users get a 503 on /old but the Ingress controller reports "Successfully reconciled". How do you find it?senior

I run kubectl describe ingress and read the backends column; in the lab it said services "shop-web-v0" not found, because a Service had been renamed and the rule was not. The ALB rule exists with no healthy targets, so events stay quiet; checking Ingress backends after every Service rename prevents it.

Read the lesson: Services, Ingress and load balancing →

Configuration

Q14You edit a ConfigMap loaded with envFrom. Why don't running Pods see the change?junior

Environment variables are read once, when the container starts. Running Pods keep the old values until they restart, for example with kubectl rollout restart deployment/shop-web. Files mounted from a ConfigMap do update eventually, which is one reason to mount whole config files instead.

Read the lesson: Configuration: ConfigMaps and Secrets →
Q15Is a Kubernetes Secret secure? What would you do for real credentials?senior

Only partly: the value is base64-encoded, not encrypted, and applying it with stringData also leaves it in plain text in the last-applied-configuration annotation, as the lab showed. I restrict get secrets with RBAC, enable KMS envelope encryption on EKS, and keep the real value in Secrets Manager or Vault, synced by the External Secrets Operator so it never lands in Git.

Read the lesson: Configuration: ConfigMaps and Secrets →

Resource management

Q16Explain requests and limits, and what happens when a container goes over each.mid

Requests are a reservation the scheduler uses to place Pods; limits are a ceiling the kernel enforces. Over a CPU limit the container is throttled, over a memory limit it is killed as OOMKilled with exit code 137. I always set requests and a memory limit, and usually leave out the CPU limit because throttling causes latency spikes that are hard to see.

Read the lesson: Resource management: requests, limits, namespaces, quotas →
Q17A Deployment shows 5/7 ready and no Pods are crashing. Where do you look?mid

I describe the ReplicaSet, because quota errors only appear there as FailedCreate events. In the lab a ResourceQuota allowed 5 Pods, so the API server refused the sixth and seventh while the Deployment itself was accepted. kubectl describe resourcequota confirms which limit is full.

Read the lesson: Resource management: requests, limits, namespaces, quotas →

Security

Q18How do you give a service account read-only access to Pods in one namespace, and prove it?mid

A Role with get, list and watch on pods and pods/log, and a RoleBinding to the service account. kubectl auth can-i delete pods --as=system:serviceaccount:default:viewer answers no without trying it. Role and RoleBinding are namespaced; cluster-wide access needs ClusterRole and ClusterRoleBinding, and RBAC is deny by default.

Read the lesson: Security: RBAC, network policies, Pod Security →
Q19You apply a default-deny ingress NetworkPolicy. What can break, and how do you recognise a blocked connection?senior

Every Pod in the namespace stops accepting connections, including traffic from the load balancer, so the Ingress breaks unless you allow it too. Blocked traffic is dropped, so clients see a timeout rather than a refusal. Policies also need a CNI that enforces them; on EKS that means the VPC CNI with enableNetworkPolicy, otherwise they are silently ignored.

Read the lesson: Security: RBAC, network policies, Pod Security →
Q20What does labelling a namespace with pod-security.kubernetes.io/enforce=restricted do?mid

Pod Security admission rejects any Pod that breaks the restricted standard: privileged containers, running as root, extra capabilities, no seccomp profile and so on. The lab's privileged Pod was refused at admission while a non-root Pod with all capabilities dropped ran. For existing namespaces I start with enforce=baseline and warn=restricted, then tighten.

Read the lesson: Security: RBAC, network policies, Pod Security →

Monitoring & logging

Q21A Pod is in CrashLoopBackOff. How do you debug it?junior

First kubectl logs, and --previous for the container before it; the lab's log said DATABASE_URL is not set. Then kubectl describe pod for the exit code and events. Exit code 1 is the app's own error, 137 is a kill such as OOM, and the growing wait between restarts is the back-off.

Read the lesson: Monitoring, logging and troubleshooting →
Q22A Pod is stuck Pending. What are the usual causes and where is the reason written?mid

Pending means the scheduler has not placed it, and the Pod's events always say why: not enough unreserved CPU or memory for its requests, a selector or taint no node satisfies, or a PVC that cannot bind. The lab showed both "2 Insufficient cpu" and a claim pointing at a StorageClass that did not exist.

Read the lesson: Monitoring, logging and troubleshooting →

Autoscaling

Q23An HPA shows <unknown>/50% and never scales. What is wrong?mid

Utilisation is usage divided by the CPU request, so a container with no request has no percentage. The other cause is metrics-server not running, since that is where the HPA reads usage. Once both are fixed it computes desired replicas as current times current utilisation over target, within min and max.

Read the lesson: Autoscaling: Pods and nodes →
Q24How do the HPA and the Cluster Autoscaler work together, and what are their limits?senior

The HPA adds Pods in seconds; when the new Pods have nowhere to fit they go Pending, and the Cluster Autoscaler raises the node group's desired size, which takes minutes while a node boots and joins. The Cluster Autoscaler looks at requests, not real usage, so honest requests matter; Karpenter is the alternative that picks an instance type to fit the Pending Pods.

Read the lesson: Autoscaling: Pods and nodes →

Scheduling

Q25What is the difference between a taint and a node selector, and why do you often need both?mid

A taint repels Pods that don't tolerate it, while a node selector or affinity attracts a Pod to matching nodes. A toleration only allows a Pod onto a tainted node; it does not send it there. To reserve nodes for batch work, I taint them so others stay off and give the batch Pods both the toleration and a node selector.

Read the lesson: Scheduling: where Pods run →
Q26A node drain hangs on one Pod with "would violate the pod's disruption budget". What happened and how do you fix it?senior

The PodDisruptionBudget allows zero disruptions: in the lab, minAvailable 2 with exactly 2 replicas, so every eviction was refused until the drain timed out. Run more replicas than the budget requires or use maxUnavailable 1; and remember PDBs only stop voluntary disruptions, not node crashes or node-pressure eviction.

Read the lesson: Scheduling: where Pods run →

Storage

Q27Why does an EBS StorageClass use volumeBindingMode WaitForFirstConsumer?mid

An EBS volume lives in one availability zone and can only attach to a node in that zone. Waiting until a Pod using the claim is scheduled means the disk is created where the Pod landed. With immediate binding the disk could be made in one zone and the Pod scheduled in another, leaving it stuck.

Read the lesson: Storage: data that outlives Pods →
Q28What survives when you delete a Pod, a PVC and a StatefulSet that use EBS?senior

Deleting the Pod keeps the data, since the volume belongs to the claim. Deleting the claim deletes the disk when reclaimPolicy is Delete, so I treat it like dropping a database and use Retain for production data. Deleting a StatefulSet does not delete its claims, which keep costing money until removed, and none of this replaces snapshots or Velero backups.

Read the lesson: Storage: data that outlives Pods →

Helm

Q29A helm upgrade --wait fails because new Pods never become ready. What state is the app in and how do you recover?mid

Helm marks the revision failed after the timeout, but the Deployment's rolling update stopped after one new Pod, so the old Pods keep serving. In the lab revision 3 failed with "Updated 1/3". helm rollback shop 2 creates revision 4 with revision 2's configuration; history is append-only, and helm get values shows what is actually deployed.

Read the lesson: Helm: packaging Kubernetes apps →
Q30What goes in a chart's templates and what goes in values?junior

Templates hold the Kubernetes YAML that is the same in every environment; values hold what changes, such as replica count and image tag, with defaults in values.yaml overridden by -f per environment or --set from CI. I run helm template to see exactly what a values change renders before installing.

Read the lesson: Helm: packaging Kubernetes apps →

Deployment patterns

Q31A rolling update to a crashing image stalls. Is the app down, and what is the catch with kubectl rollout undo?mid

No: the new Pod never passed its readiness probe, so the Deployment never removed an old one and READY stayed 2/2 in the lab. kubectl rollout undo restores the previous ReplicaSet. The catch is that undo changes the cluster but not your YAML, so the next apply of the old file brings the bad image back; the fix belongs in Git.

Read the lesson: Deployment patterns: rolling, blue-green, canary, GitOps →
Q32Compare blue-green and a Pod-count canary. When are they not enough?senior

Blue-green runs both versions in full and moves all traffic by changing the Service selector, so rollback is instant but you pay for double capacity. A Pod-count canary sends roughly one Pod's share of traffic, about 25% with 3 old and 1 new. Neither gives exact small percentages; for that I use weighted Ingress or Gateway routes, a mesh, or Argo Rollouts with metric checks.

Read the lesson: Deployment patterns: rolling, blue-green, canary, GitOps →
Q33What does GitOps with Argo CD change about how you release?mid

The desired state lives in a Git repo and Argo CD keeps the cluster matching it, with selfHeal undoing manual changes and prune removing what left Git. A release is a pull request changing the image tag and a rollback is a revert. CI only pushes images and updates Git, so it never needs cluster credentials.

Read the lesson: Deployment patterns: rolling, blue-green, canary, GitOps →

Advanced topics

Q34Applying a file with a CRD and a custom resource fails with "ensure CRDs are installed first". Why?mid

The CRD was created, but the API server had not started serving the new kind when kubectl sent the resource a moment later. Apply the CRD first, kubectl wait --for=condition=Established, then the resources; Helm keeps CRDs in a separate crds/ folder and Argo CD uses sync waves for the same reason.

Read the lesson: Advanced: inside the cluster, CRDs and many clusters →
Q35Why can a t3.medium EKS node refuse Pods while its CPU is mostly idle?senior

Two reasons. The scheduler hands out Allocatable, not capacity, and counts requests, not usage. And with the VPC CNI every Pod takes an IP from the node's network interfaces, so a t3.medium fits 17 Pods. Small instances often run out of Pod slots before CPU; prefix delegation on the VPC CNI raises that limit.

Read the lesson: Advanced: inside the cluster, CRDs and many clusters →
Q36When would you run more than one cluster, and what does it cost?senior

For environment isolation (the most common reason), smaller blast radius on upgrades, regions, or hard tenancy. The cost is upgrades, add-ons and policies multiplied by N. Terraform modules, Helm, Argo CD ApplicationSets and kubeconfig contexts keep it manageable, and I always check the current context before a destructive command.

Read the lesson: Advanced: inside the cluster, CRDs and many clusters →
← Back to the Kubernetes & Helm course