Kubernetes MCQs – Setting Up Kubernetes

21.) How is container runtime related to Kubernetes setup?

A) It’s optional
B) It hosts YAML files
C) It’s required to run containers on nodes
D) It’s used only by kubectl

Answer: Option C

Explanation: Kubernetes needs a container runtime like containerd or Docker to run containers.

22.) Which command shows all running pods in all namespaces after cluster setup?

A) kubectl get pods
B) optkubectl get pods –all-namespacesion2
C) kubectl describe pods
D) kubectl logs –all

Answer: Option B

Explanation: This command lists all pods across all namespaces in the cluster.

23.) Which file stores the kubelet’s service configuration on a Linux node?

A) /etc/kubernetes/kubelet.conf
B) /var/run/kubelet.yaml
C) ~/.kube/config
D) /opt/kubelet.yaml

Answer: Option A

Explanation: This file contains the kubelet configuration used for node operations.

24.) How is a Kubernetes Dashboard typically deployed?

A) Using Minikube only
B) kubectl dashboard
C) Using a YAML manifest file
D) Installed via kubeadm

Answer: Option C

Explanation: The Kubernetes Dashboard is deployed by applying a predefined YAML manifest.

25.) How does kubectl authenticate with the cluster?

A) Through browser cookies
B) Using an SSH key
C) Via kubeconfig credentials
D) From cluster secrets

Answer: Option C

Explanation: kubectl uses the kubeconfig file, which contains cluster credentials and certificate information.

26.) In which scenario is kubeadm preferred over Minikube?

A) Quick testing
B) Learning Helm
C) Multi-node cluster setup
D) Viewing pod logs

Answer: Option C

Explanation: kubeadm is used to set up real, multi-node clusters, unlike Minikube which is typically single-node.

27.) kubeadm is used to set up real, multi-node clusters, unlike Minikube which is typically single-node.

A) Java and Maven
B) Docker or container runtime
C) VirtualBox
D) Git and Go

Answer: Option B

Explanation: A container runtime (e.g., containerd or Docker) is required to run containers in the cluster.

28.) How do you view the join command token for worker nodes?

A) kubeadm get-token
B) kubeadm token create
C) kubeadm token list
D) kubeadm show join

Answer: Option C

Explanation: This command lists the available tokens that can be used by worker nodes to join the cluster.

29.) What must you do if a pod network plugin is not applied after kubeadm init?

A) Manually configure kubelet
B) Reboot the system
C) Apply a CNI plugin
D) Restart the API server

Answer: Option C

Explanation: The cluster won’t function properly until a pod network (CNI) plugin is installed.

30.) What does kubectl get nodes show?

A) Cluster events
B) List of deployments
C) Status of nodes in the cluster
D) Logs of pods

Answer: Option C

Explanation: This command displays all nodes and their status, roles, and readiness in the Kubernetes cluster.

Kubernetes MCQs, setting up kubernetes

Leave a Reply

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