Kubernetes MCQs – Workloads and Scheduling

21.) How can you limit the number of concurrent jobs in a CronJob?

A) Using .spec.parallelism
B) With .spec.concurrencyPolicy
C) Adding annotations
D) You cannot limit it

Answer: Option B

Explanation: This field controls how concurrent jobs are handled—e.g., Forbid, Allow, or Replace.

22.) What happens if a node running a pod goes down?

A) Kubernetes reschedules the pod on another node
B) The pod is paused
C) The deployment is deleted
D) Nothing happens

Answer: Option A

Explanation: Kubernetes detects node failure and reschedules pods to maintain availability.

23.) Which label selector helps match pods to ReplicaSets?

A) matchPods
B) selector
C) affinity
D) matchAffinity

Answer: Option B

Explanation: ReplicaSets use a selector field to match and manage pods with matching labels.

24.) What is the minimum required field for a pod spec?

A) name
B) annotations
C) labels
D) containers

Answer: Option D

Explanation: The containers field is essential because every pod must have at least one container.

25.) Which field determines the maximum unavailable pods during a rolling update?

A) replicas
B) strategy.type
C) maxUnavailable
D) tolerations

Answer: Option C

Explanation: This field sets how many pods can be unavailable during updates.

26.) What is the default concurrencyPolicy of a CronJob?

A) Replace
B) Allow
C) Forbid
D) Restart

Answer: Option B

Explanation: By default, Kubernetes allows concurrent executions of CronJobs.

27.) Which of the following is not a valid workload controller?

A) Job
B) Deployment
C) Service
D) StatefulSet

Answer: Option C

Explanation: Services expose applications but do not manage workloads.

28.) How do you restart a Deployment?

A) kubectl restart deployment
B) kubectl delete pods
C) kubectl apply deployment.yaml
D) kubectl rollout undo

Answer: Option A

Explanation: This command triggers a rollout restart of the deployment.

29.) What does parallelism define in a Job?

A) How often the job runs
B) How many pods run in parallel
C) Number of retries
D) Number of successful completions

Answer: Option B

Explanation: The parallelism field defines how many pods can run at the same time.

30.) How can you trigger a manual rollout of a deployment?

A) Change image tag
B) Reboot node
C) Delete pod
D) Delete service

Answer: Option A

Explanation: Updating the image tag causes the deployment to roll out new pods.

Kubernetes MCQs

Leave a Reply

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