Kubernetes Architecture
Top 20 Kubernetes Interview Questions & Answers (Short & Sweet)
If you're preparing for a Kubernetes interview, here are the most common questions with crisp, to-the-point answers. Save this cheat sheet!
1. What is Kubernetes?
Answer: Container orchestration platform for automating deployment, scaling, and management.
2. Difference between Docker Swarm and K8s?
Answer: Swarm is simpler, integrates with Docker; K8s is complex, feature-rich, auto-healing, and scales better.
3. What are Pods?
Answer: Smallest deployable units; one or more containers sharing network/storage.
4. What is a ReplicaSet?
Answer: Ensures a specified number of pod replicas run at all times.
5. Deployment vs StatefulSet?
Answer: Deployment for stateless apps; StatefulSet for stateful (stable network ID, persistent storage).
6. What does a Service do?
Answer: Exposes pods as network services with stable IP and load balancing.
7. Ingress vs LoadBalancer?
Answer: LoadBalancer: L4, cloud LB; Ingress: L7, HTTP routing to multiple services.
8. What is a ConfigMap?
Answer: Stores non-sensitive config data as key-value pairs for pods.
9. How to handle secrets?
Answer: Use Secret objects (base64 encoded, not encrypted by default) + RBAC.
10. What is etcd?
Answer: Distributed key-value store storing all cluster state/data.
11. Difference between kubectl apply and create?
Answer: create works only on new resources; apply creates/updates declaratively.
12. What is a Namespace?
Answer: Virtual cluster for resource isolation/quota.
13. How does kube-scheduler work?
Answer: Assigns pods to nodes based on resource reqs, affinity, taints, etc.
14. What are taints and tolerations?
Answer: Taints repel pods; tolerations let pods ignore specific taints.
15. How to debug a crash-looping pod?
Answer: kubectl logs <pod> --previous, kubectl describe pod, check probes/liveness.
16. Difference between liveness and readiness probes?
Answer: Liveness: restart container on failure; Readiness: stop sending traffic.
17. What is a DaemonSet?
Answer: Runs one pod per node (e.g., logging, monitoring).
18. How to upgrade a deployment without downtime?
Answer: RollingUpdate strategy; kubectl set image deployment/<name> <container>=<new>.
19. What is a PersistentVolume (PV) and PVC?
Answer: PV: cluster storage; PVC: pod's request for storage.
20. What is Helm?
Answer: Package manager for K8s (charts = templated K8s manifests).
Bonus Tip: Practice with kubectl explain command during the interview!
Comments (0)
Post a Comment
Cancel