Kubernetes Interview Questions

Kubernetes Interview Prep Guide This page serves as a comprehensive technical guide for Kubernetes interviews. Topics are grouped and answered in-depth to help with preparation for DevOps, SRE, and Platform Engineer roles. Each section includes detailed technical Q&A, YAML examples, comparisons, and real-world use cases. Linux and Container Fundamentals Q1: What are Linux namespaces? Namespaces provide process isolation in Linux. Types include: pid: process IDs net: networking mnt: mount points uts: hostname ipc: inter-process communication user: UID/GID Each container typically runs in its own set of namespaces to isolate processes from others. Q2: What are cgroups and how do they work? Control Groups (cgroups) limit and monitor resource usage per process or container. Manage CPU, memory, I/O, and network bandwidth. Kubernetes uses cgroups (via the container runtime) to enforce pod resource requests/limits. Q3: What does it mean when a container is a “tar of tar”? Container images are built in layers using a union filesystem. Each layer is a tarball of the diff from the previous layer. The final image is a “tar of tars” that gets extracted when the container is started. Tools like ctr, crictl, or docker handle pulling and extracting these tarballs. Q4: How do containers relate to Kubernetes? Kubernetes schedules and manages containers using Pods. It uses a container runtime (e.g., containerd) to start/stop containers. Kubernetes adds orchestration features (health checks, scaling, service discovery, etc.) on top of container runtimes. Core Kubernetes Concepts Q5: How does Kubernetes perform service discovery? Kubernetes provides two main methods for service discovery: