Kubernetes MCQs – Monitoring, Logging, and Debugging

Effective monitoring, logging, and debugging are essential for maintaining healthy Kubernetes clusters and ensuring the high availability of applications. Kubernetes offers built-in tools along with integrations like Prometheus, Grafana, Fluentd, and tools like kubectl for real-time diagnosis.

These multiple-choice questions (MCQs) are designed to help you master core concepts and practical commands used for observability in Kubernetes. This comprehensive MCQ collection is perfect for beginners to advanced learners preparing for interviews, certifications, or real-world troubleshooting.

1.) Which tool is commonly used with Kubernetes for monitoring metrics?

A) Grafana
B) Fluentd
C) Prometheus
D) Elasticsearch

Answer: Option C

Explanation: Prometheus is the most popular tool for monitoring Kubernetes metrics and alerting.

2.) What is the default logging mechanism in Kubernetes?

A) Fluentd
B) Container runtime logs to stdout/stderr
C) Elasticsearch
D) Filebeat

Answer: Option B

Explanation: Kubernetes collects logs from containers via stdout and stderr by default.

3.) Which tool provides visual dashboards for Prometheus metrics?

A) Grafana
B) Elasticsearch
C) Loki
D) Kibana

Answer: Option A

Explanation: Grafana is widely used to visualize Prometheus data in dashboards.

4.) What does the command kubectl logs show?

A) Kubernetes events
B) Metrics from Prometheus
C) Application logs for the given pod
D) All container statuses

Answer: Option D

Explanation: This command fetches logs written to stdout/stderr of the pod’s containers.

5.) Which command retrieves logs from a previous container instance?

A) kubectl logs –old
B) kubectl logs –previous
C) kubectl logs –rollback
D) kubectl logs –history

Answer: Option B

Explanation: Use –previous to view logs from the last terminated container instance.

6.) What is the purpose of Fluentd in the EFK stack?

A) Store logs
B) Visualize logs
C) Secure logs
D) Collect and forward logs

Answer: Option D

Explanation: Fluentd acts as a log collector and router between Kubernetes and storage systems like Elasticsearch.

7.) Which command helps you get detailed information about a pod?

A) kubectl logs
B) kubectl status
C) kubectl describe pod
D) kubectl view pod

Answer: Option C

Explanation: It provides complete details, including events, status, and resource usage.

8.) How can you view real-time logs from a Kubernetes pod?

A) kubectl logs -r <pod-name>
B) kubectl logs –watch <pod-name>
C) kubectl logs live <pod-name>
D) kubectl logs -f <pod-name>

Answer: Option D

Explanation: The -f or –follow flag streams real-time logs.

9.) Which tool is used to debug network connectivity between pods?

A) kube-proxy
B) cAdvisor
C) Netshoot
D) kubeadm

Answer: Option C

Explanation: Netshoot is a special-purpose container image used for network troubleshooting.

10.) Which Kubernetes component exposes metrics for kubelet and cAdvisor?

A) kube-scheduler
B) kubelet
C) coredns
D) API server

Answer: Option B

Explanation: The kubelet provides resource usage statistics from cAdvisor.

Leave a Reply

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