Kubernetes MCQs – Best Practices and Real-World Use Cases

21.) What does a DaemonSet do?

A) Ensures one pod runs on every node
B) Creates a single backup pod
C) Launches jobs at intervals
D) Builds container images

Answer: Option A

Explanation: DaemonSets are used for system-level pods like log collectors or monitoring agents.

22.) When should you use node affinity rules?

A) When nodes are behind a proxy
B) To prioritize autoscaling
C) To delete stale pods
D) To control scheduling based on node labels

Answer: Option D

Explanation: Node affinity ensures pods are scheduled on specific types of nodes.

23.) What command do you use to view the rollout status of a deployment?

A) kubectl rollout view
B) kubectl rollout status
C) kubectl status get
D) kubectl deployment info

Answer: Option B

Explanation: This shows the rollout progress and status for a deployment.

24.) What is the function of kubectl taint?

A) Create a new pod
B) Label a deployment
C) Add a taint to a node
D) Restart a job

Answer: Option C

Explanation: This command adds taints that restrict pod placement unless tolerated.

25.) How do you list all resources in a namespace?

A) kubectl all -n <namespace>
B) kubectl get all -n <namespace>
C) kubectl describe namespace <name>
D) kubectl list pods

Answer: Option B

Explanation: This command returns all resource types in the specified namespace.

Leave a Reply

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