Kubernetes MCQs with answers Page - 8

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. Which flag is used to specify the namespace in kubectl commands?

  • (A) --ns
  • (B) --namespace
  • (C) --context
  • (D) --area

A

Admin • 828.03K Points
Coach

Q. What does a Kubernetes Service selector do?

  • (A) Creates new containers
  • (B) Chooses which pods to expose
  • (C) Assigns roles to users
  • (D) Manages persistent storage

A

Admin • 828.03K Points
Coach

Q. What is the main benefit of using StatefulSets in Kubernetes?

  • (A) Faster scaling
  • (B) Simpler deployment configuration
  • (C) Stable network identities and persistent storage per pod
  • (D) More flexible scheduling

A

Admin • 828.03K Points
Coach

Q. Which Kubernetes controller is suitable for running a pod on all nodes?

  • (A) Deployment
  • (B) ReplicaSet
  • (C) DaemonSet
  • (D) StatefulSet

A

Admin • 828.03K Points
Coach

Q. What is the purpose of an init container in Kubernetes?

  • (A) Run alongside main container for background processing
  • (B) Initialize the container image
  • (C) Perform setup tasks before the main container starts
  • (D) Keep the container running after errors

A

Admin • 828.03K Points
Coach

Q. What command is used to apply a configuration file to a Kubernetes cluster?

  • (A) kubectl upload
  • (B) kubectl apply -f
  • (C) kubectl run -f
  • (D) kubectl deploy -f

A

Admin • 828.03K Points
Coach

Q. How can you expose a deployment as a service using NodePort?

  • (A) kubectl expose deployment myapp --type=NodePort
  • (B) kubectl start deployment myapp --service=nodeport
  • (C) kubectl publish myapp --type=NodePort
  • (D) kubectl map deployment myapp --port=Node

A

Admin • 828.03K Points
Coach

Q. Which of the following resources is namespaced?

  • (A) Node
  • (B) PersistentVolume
  • (C) ServiceAccount
  • (D) Namespace

A

Admin • 828.03K Points
Coach

Q. What is the purpose of kube-dns or CoreDNS in Kubernetes?

  • (A) Log container output
  • (B) Schedule containers
  • (C) Provide DNS-based service discovery
  • (D) Assign IP addresses to containers

A

Admin • 828.03K Points
Coach

Q. Which Kubernetes component manages network traffic within nodes?

  • (A) kube-apiserver
  • (B) kube-proxy
  • (C) kubelet
  • (D) etcd

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ