LearnDevOpsHands-On Labs
Back to All Interview Tracks
30 QuestionsDevOps & Cloud

Kubernetes Interview Questions

30 Kubernetes questions from real DevOps and SRE interviews, sorted by seniority: Pods, Services and networking, probes, Ingress, scheduling, storage, RBAC and Helm.

Pods & SidecarsServices & IngressReadiness & LivenessHPA & AutoscalingRBAC & ServiceAccountsStatefulSets & PVs
Showing 30 of 30 questions
•
#1

What is a Kubernetes Pod, and why would you never create one directly?

Junior

A Pod is the smallest deployable unit: one or more containers that share a network namespace, so they reach each other on localhost, and can share volumes. They are always scheduled together on one node.

You do not create bare Pods because nothing looks after them. If the node dies, a bare Pod dies with it and nothing brings it back. A controller such as a Deployment holds a desired state and reconciles toward it, so a lost Pod is replaced.

How a Deployment, ReplicaSet, Pods and a Service fit togetherA Deployment owns a ReplicaSet, which owns three Pods. A Service sits to the side and selects the same Pods by label rather than owning them, and an EndpointSlice records the Pod addresses it found.Deploymentrollouts and rollbacksReplicaSetkeeps the replica countownsPodPodPodownsServicestable name and IPEndpointSlicethe Pod IPs it foundselects by label(does not own)disposable
The Deployment owns downward, so editing a ReplicaSet or a Pod is reconciled away. The Service owns nothing: it selects by label, which is why a Service with a typo in its selector is created happily and routes nowhere.

The consequence to state out loud: Pods are disposable. Their name, their IP and their local disk are all temporary, so anything you care about belongs to a controller, a Service or a PersistentVolume rather than to the Pod.

link
#2

What is the difference between a Kubernetes Deployment, a ReplicaSet and a Pod?

#3

What does a Kubernetes Service do, and what are the types?

#4

What is the difference between a Kubernetes ConfigMap and a Secret?

#5

Which kubectl commands do you reach for first when something is broken?

#6

Explain Kubernetes liveness, readiness and startup probes.

#7

What is the difference between Kubernetes requests and limits?

#8

A Kubernetes Service has no endpoints. How do you debug it?

#9

How does a Kubernetes rolling update work, and how do you roll one back?

#10

How do you get a Kubernetes Pod to pick up a changed ConfigMap?

#11

A Kubernetes Pod is stuck in Pending. What are the possible causes?

#12

How does persistent storage work in Kubernetes?

#13

How does DNS work inside a Kubernetes cluster?

#14

When would you use a Kubernetes StatefulSet rather than a Deployment?

#15

What does reconciliation mean in Kubernetes, and why does it matter?

#16

How does Kubernetes RBAC work, and where does it go wrong?

#17

A Kubernetes node goes NotReady. What actually happens to the Pods on it?

#18

How do taints, tolerations and affinity differ in Kubernetes?

#19

What are the ways a Kubernetes application can lose requests during a deploy?

#20

When is Kubernetes the wrong tool?

#21

What replaced Kubernetes PodSecurityPolicy, and what does it do?

#22

How do you debug a Kubernetes Pod with no shell in the image?

#23

What is the difference between kubectl apply and kubectl create?

#24

How does a Kubernetes Ingress differ from a Service, and what is the Gateway API?

#25

How does the Kubernetes Horizontal Pod Autoscaler decide to scale?

#26

Walk me through what happens when you run kubectl apply on a Deployment.

#27

What is the difference between a Kubernetes emptyDir, hostPath and PersistentVolume?

#28

What is a Kubernetes namespace, and what does it not isolate?

#29

A Kubernetes namespace is stuck Terminating. What is happening and how do you fix it?

#30

What is a Kubernetes NetworkPolicy, and what happens if you never write one?