DevOps

Kubernetes Basics

Pods, Deployments, Services, ConfigMaps, Secrets, namespaces, kubectl commands, troubleshooting CrashLoopBackOff

26 interview questions·
Mid-Level
1

What is a Pod in Kubernetes?

Answer

A Pod is the smallest deployable unit in Kubernetes. It encapsulates one or more containers that share the same network namespace, storage space, and IP address. Containers within a Pod can communicate via localhost and share the same lifecycle. In most cases, a Pod contains a single main container, but sidecar containers can be added for features like logging or monitoring.

2

What are the two main components of the Kubernetes control plane?

Answer

The Kubernetes control plane mainly comprises the API Server (kube-apiserver) which exposes the Kubernetes API and serves as the entry point for all operations, and etcd which is the distributed key-value database storing cluster state. Other components include the scheduler (kube-scheduler) that assigns Pods to nodes, and the controller manager (kube-controller-manager) that runs control loops. The API Server is the central component that all other components communicate with.

3

What is the role of kubelet in a Kubernetes node?

Answer

The kubelet is an agent running on each worker node of the cluster. It is responsible for managing Pods on its node: it monitors Pod specifications assigned by the API Server, starts and stops containers via the container runtime, monitors their health via probes (liveness, readiness), and reports status to the control plane. The kubelet ensures that containers defined in PodSpecs are running and healthy.

4

What is the difference between a liveness probe and a readiness probe?

5

What are labels used for in Kubernetes?

6

Which kubectl command shows events for a specific Pod?

+23 interview questions

Master DevOps for your next interview

Access all questions, flashcards, technical tests and interview simulators.

Start for free