Kubernetes MCQs with answers Page - 6

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. How can you inspect logs of a Kubernetes pod named 'web-pod'?

  • (A) kubectl logs web-pod
  • (B) kubectl describe logs web-pod
  • (C) kubectl get logs web-pod
  • (D) kubectl read web-pod

A

Admin • 828.03K Points
Coach

Q. What is the purpose of a namespace in Kubernetes?

  • (A) To assign IP addresses
  • (B) To define roles and users
  • (C) To isolate groups of resources within a cluster
  • (D) To replicate containers

A

Admin • 828.03K Points
Coach

Q. What does the 'kubectl rollout undo deployment <deployment-name>' command do?

  • (A) Deletes the deployment
  • (B) Scales the deployment
  • (C) Rolls back the deployment to a previous revision
  • (D) Creates a new deployment

A

Admin • 828.03K Points
Coach

Q. What is the use of a sidecar container in a Kubernetes pod?

  • (A) To balance load between pods
  • (B) To scale containers
  • (C) To enhance or extend the main container's functionality
  • (D) To expose the pod to external traffic

A

Admin • 828.03K Points
Coach

Q. What does the 'kubectl get all' command display?

  • (A) All nodes in the cluster
  • (B) All pods only
  • (C) All resources in the current namespace
  • (D) All containers inside a pod

A

Admin • 828.03K Points
Coach

Q. Which type of Kubernetes service routes traffic based on HTTP path or hostnames?

  • (A) LoadBalancer
  • (B) ClusterIP
  • (C) NodePort
  • (D) Ingress

A

Admin • 828.03K Points
Coach

Q. What is the role of kube-controller-manager in Kubernetes?

  • (A) Schedule pods on nodes
  • (B) Control node networking
  • (C) Run background controller processes
  • (D) Encrypt secrets

A

Admin • 828.03K Points
Coach

Q. What command shows all available contexts in your kubeconfig file?

  • (A) kubectl show contexts
  • (B) kubectl get-contexts
  • (C) kubectl config get-contexts
  • (D) kubectl view contexts

A

Admin • 828.03K Points
Coach

Q. How can you scale a deployment to 5 replicas?

  • (A) kubectl resize deployment my-deploy 5
  • (B) kubectl scale deployment my-deploy --replicas=5
  • (C) kubectl update deployment my-deploy 5
  • (D) kubectl patch deployment my-deploy --size=5

A

Admin • 828.03K Points
Coach

Q. What is a NodePort service used for?

  • (A) Internal communication only
  • (B) Assigning static IP to a pod
  • (C) Exposing services on a specific port on each node
  • (D) Balancing pod loads

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