Kubernetes MCQs with answers Page - 19

Here, you will find a collection of MCQ questions on Kubernetes. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 828.03K Points
Coach

Q. What happens when you run `kubectl scale deployment myapp --replicas=0`?

  • (A) Deletes the deployment
  • (B) Pauses the deployment
  • (C) Stops all pods of the deployment
  • (D) Removes all services

A

Admin • 828.03K Points
Coach

Q. Which API resource defines permissions at the cluster level?

  • (A) Role
  • (B) ClusterRole
  • (C) Binding
  • (D) Namespace

A

Admin • 828.03K Points
Coach

Q. Which field controls the update strategy for a deployment?

  • (A) replicas
  • (B) selector
  • (C) strategy
  • (D) template

A

Admin • 828.03K Points
Coach

Q. How do you export a deployment’s configuration to a YAML file?

  • (A) kubectl get deployment myapp > deploy.yaml
  • (B) kubectl fetch deployment myapp -o yaml
  • (C) kubectl get deployment myapp -o yaml > deploy.yaml
  • (D) kubectl yaml deployment myapp

A

Admin • 828.03K Points
Coach

Q. What does `kubectl exec` allow you to do?

  • (A) Delete a pod
  • (B) List services
  • (C) Run a command inside a running container
  • (D) View pod logs