Kubernetes MCQs – Kubernetes Core Concepts

11.) What does the term “desired state” in Kubernetes mean?

A) The current configuration
B) The state after deleting pods
C) The intended configuration defined by the user
D) The state after restarting the cluster

Answer: Option C

Explanation: The desired state is what the user wants the system to be, defined in YAML or JSON.

12.) What is used to uniquely identify a pod across time and space?

A) Name
B) IP address
C) UID
D) Hostname

Answer: Option C

Explanation: Kubernetes assigns a unique identifier (UID) to each pod for tracking and auditing.

13.) Which component runs on each node and manages container lifecycle?

A) Scheduler
B) Kubelet
C) Controller
D) Proxy

Answer: Option B

Explanation: Kubelet ensures that the containers in a pod are running and healthy on a node.

14.) What is a Headless Service used for?

A) Load balancing
B) Monitoring
C) Logging
D) Exposing pods without a cluster IP

Answer: Option D

Explanation: Headless Services don’t allocate a cluster IP and are used for direct pod discovery.

15.) What format is used to define Kubernetes resources declaratively?

A) XML
B) JSON or YAML
C) CSV
D) INI

Answer: Option B

Explanation: Kubernetes resources are defined in YAML or JSON format for declarative management.

16.) Which command lists all Deployments in the default namespace?

A) kubectl show deployments
B) kubectl get deployment
C) kubectl deployments list
D) kubectl get pods

Answer: Option B

Explanation: This command shows all deployments in the current namespace.

17.) What happens when a pod is deleted manually?

A) A new pod is scheduled if it’s part of a ReplicaSet or Deployment
B) It’s never recreated
C) All services are deleted
D) Cluster restarts

Answer: Option A

Explanation: The ReplicaSet or Deployment controller ensures desired state is maintained by creating a new pod.

18.) Which Kubernetes object is responsible for ensuring a pod is restarted if it fails?

A) Pod
B) Node
C) Controller
D) ReplicaSet

Answer: Option D

Explanation: ReplicaSet ensures the specified number of pods are running; if one fails, it creates another.

19.) What is the role of the kube-proxy component?

A) Deploys new pods
B) Handles network routing to services
C) Manages storage volumes
D) Maintains pod logs

Answer: Option B

Explanation: kube-proxy manages network rules for communication between services and pods.

20.) Which component stores the cluster state in Kubernetes?

A) Scheduler
B) API Server
C) etcd
D) Controller Manager

Answer: Option C

Explanation: etcd is a distributed key-value store used to hold the cluster’s state and configurations.

Leave a Reply

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