Kubernetes MCQs – Kubernetes Core Concepts

21.) How are labels different from annotations in Kubernetes?

A) Labels are not searchable
B) Annotations are used for grouping
C) Labels are used for selection/filtering
D) Annotations can be used to schedule pods

Answer: Option C

Explanation: Labels are used to select and group Kubernetes objects; annotations store metadata.

22.) What kind of object is responsible for applying a rolling update in Kubernetes?

A) Pod
B) Node
C) Namespace
D) Deployment

Answer: Option D

Explanation: Deployments manage updates to pods and allow rolling updates and rollbacks.

23.) What does a “Node” represent in a Kubernetes cluster?

A) A container
A deployment script
C) A single machine (virtual or physical)
D) A network rule

Answer: Option C

Explanation: A node is a physical or virtual machine in the Kubernetes cluster that runs pods.

24.) What is the purpose of readiness probes in pods?

A) To restart containers
B) To delay startup
C) To limit memory
D) To check if the pod is ready to receive traffic

Answer: Option D

Explanation: Readiness probes determine when a pod is ready to serve requests.

25.) What is the default restart policy for a Kubernetes pod?

A) Never
B) OnFailure
C) Always
D) Manual

Answer: Option C

Explanation: By default, pods managed by a controller are set to always restart.

26.) What command shows all services in all namespaces?

A) kubectl get service
B) kubectl get svc –all-namespaces
C) kubectl service list
D) kubectl show services

Answer: Option B

Explanation: This command lists services across all namespaces.

27.) What is the maximum number of containers a pod can run?

A) 1
B) 10
C) 100
D) No fixed limit

Answer: Option D

Explanation: Kubernetes does not set a strict limit on the number of containers per pod.

28.) What is the main purpose of taints and tolerations?

A) To apply limits
B) To isolate networking
C) To control which pods can be scheduled on specific nodes
D) To enable service discovery

Answer: Option C

Explanation: Taints and tolerations work together to restrict pod placement on nodes.

29.) Which controller ensures the current state of pods matches the desired state?

A) kubelet
B) Deployment controller
C) Scheduler
D) API Server

Answer: Option B

Explanation: The Deployment controller ensures that the desired number of replicas are running.

30.) Which component validates and configures data for the API objects?

A) API Server
B) Kubelet
C) Scheduler
D) Controller

Answer: Option A

Explanation: The API Server is the front-end for the Kubernetes control plane and handles all communication and validation.

Leave a Reply

Your email address will not be published. Required fields are marked *