Kubernetes MCQs – Monitoring, Logging, and Debugging

11.) What is the purpose of the kubectl top command?

A) View current resource usage (CPU, memory)
B) View top-performing containers
C) View top logs
D) View sorted pod logs

Answer: Option A

Explanation: The kubectl top command displays real-time resource usage stats.

12.) Which plugin needs to be installed to use kubectl top?

A) coredns
B) metrics-server
C) Prometheus
D) helm

Answer: Option B

Explanation: The metrics-server must be deployed for the kubectl top command to function.

13.) What command shows the current state of the nodes?

A) kubectl get node-state
B) kubectl status nodes
C) kubectl get nodes
D) kubectl describe nodes

Answer: Option C

Explanation: This command lists all nodes and their current statuses.

14.) How do you check if a pod has restarted due to a crash?

A) kubectl describe pod → look for Restart Count
B) kubectl logs –check
C) kubectl crash-pod
D) kubectl top pod

Answer: Option A

Explanation: The restart count is displayed in the pod’s detailed information.

15.) What is the command to get logs from a specific container in a pod?

A) kubectl logs <container-name>
B) kubectl show logs <pod> <container-name>
C) kubectl get logs -c <container-name>
D) option4 <pod-name> -c <container-name>

Answer: Option D

Explanation: This is needed when a pod contains multiple containers.

16.) What is the main purpose of cAdvisor in Kubernetes?

A) Log aggregation
B) Metrics collection for containers
C) Deploying applications
D) Managing Secrets

Answer: Option B

Explanation: cAdvisor collects and exposes resource usage and performance metrics.

17.) Which component can be used to set up alerts in Kubernetes monitoring?

A) Fluentd
B) Etcd
C) Grafana
D) Alertmanager

Answer: Option D

Explanation: Alertmanager works with Prometheus to handle alerts.

18.) What type of metrics does Prometheus primarily collect?

A) Logs
B) Time-series metrics
C) Audit logs
D) Network packets

Answer: Option B

Explanation: Prometheus collects and stores metrics as time-series data.

19.) What does the kubelet expose for debugging purposes?

A) Metrics and logs
B) Dashboards
C) API tokens
D) Prometheus exporters

Answer: Option A

Explanation: The kubelet provides metrics and logs to help with debugging nodes and pods.

20.) What is the default location for container logs on the node?

A) /logs
B) /etc/container/logs
C) /var/log/containers
D) /home/kubernetes/logs

Answer: Option C

Explanation: Kubernetes stores container logs in this directory on each node.

Leave a Reply

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