Kubernetes Interview Questions

261 multiple-choice tech interview questions on Kubernetes: control plane and nodes, pods, deployments and services, config and secrets, probes, scaling, ingress, troubleshooting. Written for technical phone screens and interview prep, organized by subtopic, with a short explanation for every answer. Learn the 238 key terms with the flashcards first, then test yourself.

Take the practice test · Flashcards · All study tools

What it covers

  1. 7.1 Architecture and the Kubernetes API
  2. 7.2 Pods and containers
  3. 7.3 Workload controllers
  4. 7.4 Services, DNS and traffic
  5. 7.5 Configuration and storage
  6. 7.6 Scheduling and resource management
  7. 7.7 Health, autoscaling and availability
  8. 7.8 Security and multi-tenancy
  9. 7.9 Operations, tooling and troubleshooting

Key terms

7.1 Architecture and the Kubernetes API

Control plane
The components that manage the cluster: API server, etcd, scheduler and controllers
etcd
Distributed key-value store holding all Kubernetes cluster state
kubelet
Node agent that runs and monitors the pod's containers
kube-controller-manager
Process running Kubernetes' core controllers
cloud-controller-manager
Control plane part that talks to cloud APIs
kube-proxy
Node agent implementing Service networking
CRI
Interface between the kubelet and container runtimes
Admission controllers
Plugins that mutate or validate API requests
ValidatingAdmissionPolicy
In-process admission rules written in CEL
Request flow
Stages of an API server request
CRD
Definition that extends the API with custom types
Operator
Custom controller plus CRDs automating an app
API groups
Families of API resources with versions
kubectl api-resources
Lists available resource types
Static pod
Pod managed directly by a kubelet, not the API server
kubeadm
Tool for creating clusters
Release cadence
How often minor versions ship
Version skew
Allowed version gaps between components
Labels vs annotations
Selectable tags versus free-form metadata
Label selectors
Expressions matching objects by labels
Owner references
Links from dependents to their owner
Finalizers
Keys that delay deletion until cleanup
Server-side apply
Field ownership tracked by the API server
Declarative vs imperative
apply from files versus one-off commands
Local clusters
Lightweight Kubernetes for development
spec vs status
Desired versus observed state of an object

7.2 Pods and containers

Pod sharing
Shared network and storage within a pod
Init containers
Setup containers that finish before the app starts
Pod phases
High-level lifecycle states of a pod
restartPolicy
When the kubelet restarts a pod's containers
Pause container
Infrastructure container anchoring a pod
Ephemeral containers
Temporary debug containers added to a running pod
command and args
Fields replacing ENTRYPOINT and CMD
Downward API
Exposing pod metadata to containers
Downward API volume
Pod metadata projected as files
Graceful termination
Shutdown sequence for pod containers
preStop hook
Handler run before a container is terminated
postStart hook
Handler run right after container creation
Ephemeral pod IPs
Pod addresses that change on replacement
emptyDir
Scratch volume tied to a pod's lifetime
imagePullPolicy
When the kubelet pulls images
Image digest
Content hash identifying an exact image
Multi-container patterns
Sidecar, ambassador and adapter designs
Bare pods
Pods with no managing controller
Readiness gates
Custom conditions included in pod readiness
Shared process namespace
Containers in a pod seeing each other's processes
Termination race
Traffic arriving after shutdown starts
containerPort
Declared container port
Container restarts
Per-container restart within a pod
hostAliases
Extra hosts-file entries for a pod
Node failure eviction
Pods removed from unreachable nodes
Init failure
Blocked startup when an init container fails
Pod naming
Generated names for controller-made pods
activeDeadlineSeconds
Max active time for a pod

7.3 Workload controllers

Pod
Smallest deployable unit: one or more containers sharing network and storage
Deployment
Manages replicated, stateless pods with rolling updates
StatefulSet
Manages stateful pods with stable names and storage
ReplicaSet
Keeps a set number of identical pods running
rollout undo
Rolling back a Deployment
rollout status
Watching a rollout until done
revisionHistoryLimit
Number of old ReplicaSets kept
Pause and resume
Holding rollouts while editing a Deployment
progressDeadlineSeconds
Time before a stalled rollout is flagged
Rollout trigger
Pod template changes create revisions
rollout restart
Rolling restart of a Deployment's pods
minReadySeconds
Time a new pod must be ready before counting
OrderedReady
Default sequential StatefulSet pod management
volumeClaimTemplates
Per-pod PVCs created by a StatefulSet
Stable network identity
Per-pod DNS names for StatefulSets
StatefulSet partition
Limit updates to higher ordinals
DaemonSet tolerations
Tolerations letting DaemonSets reach tainted nodes
completions and parallelism
Job size and concurrency
backoffLimit
Max retries for a Job
Indexed Job
Job where each pod has a completion index
TTL after finished
Automatic cleanup of finished Jobs
concurrencyPolicy
How CronJobs handle overlapping runs
CronJob timeZone
Time zone for a CronJob schedule
startingDeadlineSeconds
Window for starting late CronJob runs
podFailurePolicy
Rules for handling Job pod failures
kubectl scale
Changing replica counts
Immutable selector
Deployment selectors can't change

7.4 Services, DNS and traffic

Service
Stable virtual IP and DNS name that load-balances across matching pods
Ingress
Routes external HTTP traffic to services by host and path
NodePort
Service exposed on a port on every node
LoadBalancer Service
Service exposed through a cloud LB
ExternalName
Service that aliases an external DNS name
EndpointSlices
Scalable groups of Service endpoints
Selector mismatch
Service labels not matching pods
port vs targetPort
Service port versus container port
Named ports
Referring to container ports by name
sessionAffinity
Sticky routing by client IP
externalTrafficPolicy
Whether external traffic may cross nodes
Selectorless Service
Service with manually managed endpoints
CoreDNS
Cluster DNS server
ndots
Resolver setting that triggers search-domain lookups
dnsPolicy
How a pod's DNS is configured
Network model
Flat, routable pod networking
CNI
Container Network Interface plugins
Pod IP exhaustion
Subnet addresses used up by pods
Policy enforcement
CNI support needed for NetworkPolicy
Default deny
Policy selecting all pods with no allow rules
DNS egress
Allowing DNS under egress restrictions
Ingress controller
Software that implements Ingress rules
Ingress TLS
Certificates for Ingress hosts
IngressClass
Links Ingresses to a controller
internalTrafficPolicy
Restricting in-cluster Service traffic to the local node
Virtual IP
ClusterIP implemented by forwarding rules

7.5 Configuration and storage

envFrom
Importing all keys from a ConfigMap or Secret
ConfigMap size
Max data in a ConfigMap
configmap --from-file
Creating ConfigMaps from files
Config change rollout
Restarting pods to pick up new config
PV and PVC
Storage resource and a claim on it
StorageClass
Template for dynamically provisioned storage
Default StorageClass
Class used when a PVC names none
Access modes
How volumes can be mounted
ReadWriteOnce
Single-node read-write access
reclaimPolicy
What happens to a PV after its claim is gone
WaitForFirstConsumer
Delaying volume creation until scheduling
Volume expansion
Growing a bound PVC
CSI
Container Storage Interface drivers
VolumeSnapshot
API for snapshotting volumes
hostPath
Mounting a node directory into a pod
Projected volume
One mount combining multiple sources
Pending PVC
Claim that can't be bound
Zonal volumes
Disks usable only in one zone
Shared storage on AKS
Azure Files for many-node access
fsGroup
Group applied to volume files
Local PV
Persistent volume on a node's own disk
configMapGenerator
Kustomize ConfigMaps with content-hash names
Released PV
Volume whose claim was deleted
Dependent env vars
Expanding one variable inside another
Read-only mounts
Volume mounts the container can't modify
Generic ephemeral volume
Inline PVC tied to a pod's lifetime

7.6 Scheduling and resource management

nodeSelector
Simple label match for node placement
Node affinity
Rules for which nodes a pod may use
Pod affinity
Co-locating pods by labels and topology
Topology spread
Balancing pods across zones or nodes
Taint effects
NoSchedule, PreferNoSchedule, NoExecute
Cordon and drain
Marking nodes unschedulable and evicting pods
Limit enforcement
Throttling for CPU, killing for memory
QoS classes
Guaranteed, Burstable and BestEffort
Eviction order
Which pods are evicted first under pressure
Node-pressure eviction
Kubelet evicting pods to protect the node
Priority and preemption
Pod priority that can evict lower ones
ResourceQuota
Namespace-wide caps on resources and objects
Millicores
CPU units in Kubernetes
Memory units
Binary versus decimal suffixes
Allocatable
Node resources available for pods
Filter and score
Two phases of scheduling
No CPU limits
Avoiding CPU throttling while keeping requests
In-place resize
Updating container resources on a running pod
DRA
Claim-based device allocation
Extended resources
Custom node resources like GPUs
nodeName
Directly binding a pod to a node
Descheduler
Tool that rebalances by evicting pods
Ephemeral storage
Local disk usage by pods
Blocking PDB
Budget that permits no evictions
Topology labels
Standard labels for region and zone
Insufficient resources
Scheduling failure from lack of capacity
schedulerName
Choosing a scheduler for a pod

7.7 Health, autoscaling and availability

Probe handlers
Ways a probe checks a container
Probe timing
Period times failure threshold
Startup budget
Startup period times threshold
HPA formula
How the HPA computes desired replicas
HPA unknown metrics
HPA can't read metrics
Utilization basis
HPA percentages relative to requests
Stabilization window
Delay that smooths HPA scale-down
HPA behavior
Rate limits for HPA scaling
Custom metrics
App metrics fed to the HPA via an adapter
HPA minimum
HPA's minReplicas floor
HPA and VPA conflict
Competing autoscalers on one metric
VPA modes
How the VPA applies its recommendations
Cluster Autoscaler
Adds and removes nodes based on scheduling
Multiple HPA metrics
HPA picks the largest computed replica count
KEDA cron scaler
Time-based scaling with KEDA
kubectl autoscale
Imperative HPA creation
Container metrics
HPA metrics for a single container
autoscaling/v2
Current HPA API version
AKS node auto-provisioning
Karpenter-based node management on AKS
HPA sync period
Interval of HPA evaluations
Readiness in rollouts
Rollouts gated on new pod readiness
HPA tolerance
Dead band around the target
Probe tuning
Different sensitivities for readiness and liveness
Unhealthy pod eviction
PDB setting for pods that aren't ready
HPA targets column
Current versus target metric values

7.8 Security and multi-tenancy

Role and ClusterRole
Namespaced versus cluster-wide permission sets
RoleBinding to ClusterRole
Reusing a cluster role in one namespace
kubectl auth can-i
Checking RBAC permissions
Token automount
Whether a pod gets an API token
Additive RBAC
RBAC has no deny rules
Pod creation risk
Creating pods implies access to namespace resources
Pod Security Standards
Policy levels for pod security
Pod Security Admission
Built-in enforcement via namespace labels
PodSecurityPolicy
Removed pod security API
runAsNonRoot
Blocking containers that run as UID 0
Read-only root
Immutable container file system
Dropping capabilities
Removing root powers from containers
allowPrivilegeEscalation
Blocking setuid-style privilege gains
Privileged containers
Containers with host-level access
seccomp
System call filtering for containers
Sandboxed runtimes
Extra isolation via RuntimeClass
Policy engines
Admission-time policy enforcement
RBAC wildcards
Broad grants that grow over time
escalate and bind
RBAC verbs that bypass escalation checks
Audit levels
How much the API server audit log records
Users
External identities for humans
Multi-tenancy
Degrees of isolation between tenants
User namespaces
Separate UID mapping for pods
Falco
Runtime threat detection
kube-bench
CIS benchmark checker for Kubernetes
Kubelet API
Node agent's HTTPS endpoint
NodeRestriction
Limits what kubelets can modify

7.9 Operations, tooling and troubleshooting

Readiness probe
Check that decides whether a pod receives traffic
Liveness probe
Check that restarts a container when it fails
HorizontalPodAutoscaler
Scales pod replicas based on metrics
logs --previous
Logs of the last terminated container
Container logs
Selecting a container with -c
kubectl exec
Running commands inside a container
port-forward
Local tunnel to a pod or Service
Exit code 137
Killed by SIGKILL, often for memory
Events
Cluster records of what happened
kubectl top
Live CPU and memory usage
Contexts
Cluster, user and namespace sets in kubeconfig
Default namespace
Namespace stored in the context
kubectl explain
Field documentation from the API
kubectl diff
Preview of an apply
jsonpath output
Extracting fields from kubectl output
helm upgrade --install
Install-or-upgrade a release
helm rollback
Restoring an earlier release revision
helm template
Local rendering of a chart
Helm value precedence
Order in which values override
Deprecated API checks
Finding soon-removed API versions
Upgrade path
One minor version per control plane upgrade
k9s
Terminal dashboard for Kubernetes
kubectl wait
Blocking until a condition is met
Stuck Terminating
Pods that won't finish deleting
NotReady node
Node whose kubelet isn't reporting healthy
CreateContainerConfigError
Container config can't be built

Sample practice questions

  1. Which control plane component stores all cluster state?

    1. etcd
    2. kubelet
    3. kube-proxy
    4. CoreDNS

    Answer: A. etcd etcd is a consistent, distributed key-value store; back it up in self-managed clusters.

  2. What is a pod?

    1. A single physical server that has joined the Kubernetes cluster
    2. A named group of nodes that share the same hardware profile
    3. A container image stored in the cluster's built-in registry
    4. One or more containers sharing an IP and volumes; the smallest unit

    Answer: D. One or more containers sharing an IP and volumes; the smallest unit Containers in the same pod talk over localhost; sidecars are a common multi-container pattern.

  3. What does a Deployment manage?

    1. A single pod with a stable network identity and its own storage
    2. ReplicaSets keeping identical pods running, with rolling updates
    3. Exactly one pod on every node in the cluster, like a log agent
    4. Batch jobs that run once to completion and then stop for good

    Answer: B. ReplicaSets keeping identical pods running, with rolling updates `kubectl rollout undo deployment/api` rolls back to the previous revision.

  4. Why do you need a Service in front of pods?

    1. Pods can't receive any traffic at all unless they have a public IP
    2. Services are what build the container images that pods run
    3. Services store the secrets that pods need to start up
    4. Pod IPs change; a Service gives a stable IP and DNS name and balances

    Answer: D. Pod IPs change; a Service gives a stable IP and DNS name and balances Services select pods by labels.

  5. What is a ConfigMap?

    1. Non-secret config as key-value pairs, mounted or set as env vars
    2. An encrypted store for passwords, tokens and other credentials
    3. A map showing every node in the cluster and its location
    4. A routing table that controls traffic between namespaces

    Answer: A. Non-secret config as key-value pairs, mounted or set as env vars Keep configuration out of images so the same image runs in every environment.

  6. Why set resource requests and limits on containers?

    1. They're required for the container image to build successfully
    2. Requests guide scheduling; limits stop one container starving others
    3. They determine which IP address the pod is assigned on startup
    4. They control how many replicas of the pod the cluster runs

    Answer: B. Requests guide scheduling; limits stop one container starving others A container exceeding its memory limit is OOM-killed; exceeding the CPU limit is throttled.

  7. What does a readiness probe control?

    1. Whether the kubelet restarts the container after it fails
    2. Whether Services send the pod traffic; failing it doesn't restart
    3. Whether the node pulls the container image again
    4. Whether the node itself is marked healthy or not

    Answer: B. Whether Services send the pod traffic; failing it doesn't restart Liveness probes restart stuck containers; startup probes protect slow-starting apps from early liveness checks.

  8. What are namespaces used for in Kubernetes?

    1. Giving each pod its own isolated Linux kernel for stronger security
    2. Naming and versioning the container images stored in a registry
    3. Splitting a cluster into virtual groups that scope names, RBAC and quotas
    4. Assigning IP addresses from different ranges to the cluster's nodes

    Answer: C. Splitting a cluster into virtual groups that scope names, RBAC and quotas Namespaces are not a hard security boundary on their own; combine them with RBAC and network policies.

  9. A pod shows status `CrashLoopBackOff`. What does it mean?

    1. The container image can't be pulled from the registry at all
    2. The pod is still waiting to be scheduled onto a node
    3. The pod has finished its work successfully and exited
    4. The container keeps crashing, and restarts are delayed longer each time

    Answer: D. The container keeps crashing, and restarts are delayed longer each time Check `kubectl logs <pod> --previous` and `kubectl describe pod` for the cause.

  10. What does the kube-scheduler do?

    1. Runs the containers on each node and restarts them when they fail
    2. Assigns new pods to nodes using requests, constraints and affinity
    3. Stores the cluster's configuration and state as key-value pairs
    4. Routes external traffic from the internet to the right services

    Answer: B. Assigns new pods to nodes using requests, constraints and affinity The kubelet on the chosen node then starts the pod's containers.

Practice all 261 questions

More Cloud and DevOps