DevOps
Kubernetes interview questions on pods, deployments, services, config maps, and cluster management for production orchestration.
What is a Pod and why is it the smallest deployable unit?
Tip: A Pod wraps one or more tightly-coupled containers that share a network namespace (same IP/localhost) and storage volumes. Kubernetes schedules and scales Pods, not bare containers, so a sidecar (e.g. logging) can co-locate with the main app and communicate over localhost.
What is the difference between a Deployment, ReplicaSet, and StatefulSet?
Tip: A ReplicaSet keeps N identical Pod replicas running. A Deployment manages ReplicaSets to enable rolling updates and rollbacks (use for stateless apps). A StatefulSet gives stable network IDs and persistent storage per Pod with ordered startup — for databases and clustered stateful workloads.
How do Services enable networking in Kubernetes?
Tip: A Service gives a stable virtual IP/DNS name in front of a changing set of Pods (selected by labels), load-balancing across them. Types: ClusterIP (internal), NodePort (port on each node), LoadBalancer (cloud LB), and Ingress for HTTP routing by host/path.
How does Kubernetes self-healing and the reconciliation loop work?
Tip: You declare desired state (e.g. 3 replicas); controllers continuously compare actual vs desired and act to converge — restarting crashed Pods, rescheduling on node failure, recreating to match the spec. This declarative control loop is the heart of Kubernetes.
What are liveness and readiness probes?
Tip: A liveness probe restarts a container that is stuck/deadlocked. A readiness probe decides whether a Pod should receive traffic — failing it removes the Pod from Service endpoints without restarting it (useful during warm-up or dependency outages). A startup probe protects slow-starting apps.
How do ConfigMaps and Secrets differ?
Tip: Both inject configuration into Pods as env vars or mounted files, keeping config out of images. ConfigMaps hold non-sensitive data; Secrets hold sensitive data (base64-encoded by default — enable encryption at rest and RBAC for real protection).
How does Kubernetes autoscaling work?
Tip: The Horizontal Pod Autoscaler scales Pod replicas based on CPU/memory or custom metrics. The Vertical Pod Autoscaler adjusts Pod resource requests. The Cluster Autoscaler adds/removes nodes when Pods can't be scheduled. Together they scale workload and infrastructure.
What is a namespace and when do you use one?
Tip: Namespaces partition a cluster into virtual sub-clusters for isolation — separating teams or environments (dev/staging/prod). They scope names, RBAC, resource quotas, and network policies, but do not provide hard security isolation on their own.
InterviewEra generates role-specific questions using your actual projects and skills. Get scored feedback on technical depth, clarity, and structure — free to start.