title: "Kubernetes Interview Questions โ Basics" description: "Prepare for your Kubernetes interview with beginner-level questions covering fundamentals, core concepts, and essential commands for freshers."
Kubernetes Interview Questions - Basics¶
How to use these interview questions
๐ง Read each question carefully.
Try answering it yourself before expanding the answer to compare with the ideal response.
Level: Basics
๐ข Foundational interview questions.
Focus on core concepts, definitions, and building blocks.
Core Concepts¶
What is Kubernetes?
Kubernetes (K8s) is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications.
What are the main components of Kubernetes Architecture?
- Control Plane: API Server, etcd, Scheduler, Controller Manager.
- Worker Nodes: Kubelet, Kube-proxy, Container Runtime.
What is a Pod?
A Pod is the smallest deployable unit in Kubernetes. It represents a single instance of a running process and can hold one or more containers sharing network and storage.
Difference between Pod and Container?
- Container: The isolated environment (Docker).
- Pod: A wrapper around containers, managed by K8s.
What is a ReplicaSet?
It ensures that a specified number of pod replicas are running at any given time, guaranteeing availability.
What is a Deployment?
It manages Pods and ReplicaSets, providing declarative updates (like rolling updates) to the application state.
What is a Namespace?
A virtual cluster inside a physical cluster, used to isolate resources between teams or environments (e.g., dev, prod).
Networking & Services¶
What is a Service?
An abstraction that defines a logical set of Pods and a policy to access them (stable IP/DNS).
Types of Services?
- ClusterIP: Internal only (Default).
- NodePort: Exposes on static port on each node.
- LoadBalancer: Uses cloud provider LB.
- ExternalName: DNS alias.
Tools & CLI¶
What is Minikube?
A tool to run a single-node local Kubernetes cluster for testing.
What is kubectl?
The command-line tool used to communicate with the Kubernetes API Server to manage the cluster resources.
Lifecycle & Management¶
Explain the 'Pending' status of a Pod.
The Pod has been accepted by the system, but the scheduler hasn't found a suitable node to run it yet (e.g., due to resource constraints or constraints).
How do you scale a Deployment?
Imperative: kubectl scale deployment <name> --replicas=5
Declarative: Update replicas: 5 in the YAML and run kubectl apply -f file.yaml.
How do you delete a Pod?
kubectl delete pod <pod-name>. If managed by a Deployment, it will be recreated. To remove it permanently, delete the Deployment.
What is the difference between kubectl create and kubectl apply?
create: Imperative command to create a new resource. Fails if it exists.apply: Declarative command. Creates if missing, updates if exists (manages configuration drift).
What is a Container Runtime?
The software responsible for running containers. Examples: Docker Engine, containerd, CRI-O.
How can you view the logs of a container?
kubectl logs <pod-name>. If multi-container: kubectl logs <pod-name> -c <container-name>.
What is etcd?
A consistent and highly-available key-value store used as the backing store for all cluster data (the "brain" of the cluster config).
What happens if the Master Node goes down?
The cluster functions (pods keep running), but you cannot manage it (no API access, no scheduling of new pods, no self-healing if pods die).
How do you get a shell into a running container?
kubectl exec -it <pod-name> -- /bin/bash (or /bin/sh).
๐ฌ DevopsPilot Weekly โ Learn DevOps, Cloud & Gen AI the simple way.
๐ Subscribe here