CKA Resource Monitoring 1 — Questions and Answers
Question 1: What command shows CPU and memory usage of nodes in Kubernetes?
- kubectl top nodes (Correct answer)
- kubectl get nodes
- kubectl describe nodes
- kubectl status nodes
Correct answer: kubectl top nodes
kubectl top nodes displays real-time CPU and memory usage metrics for all nodes in the cluster, requiring metrics-server to be installed.
Question 2: What is the Metrics Server in Kubernetes?
- A cluster-wide aggregator of resource usage data (Correct answer)
- A logging system
- A network proxy
- A storage manager
Correct answer: A cluster-wide aggregator of resource usage data
Metrics Server collects CPU and memory usage data from kubelets on each node and makes it available through the Kubernetes API for HPA and kubectl top commands.
Question 3: What is a Horizontal Pod Autoscaler (HPA)?
- A controller that automatically scales Pod replicas based on metrics (Correct answer)
- A manual scaling tool
- A load balancer
- A storage provisioner
Correct answer: A controller that automatically scales Pod replicas based on metrics
HPA automatically adjusts the number of Pod replicas in a Deployment based on observed CPU utilization or custom metrics, scaling up under load and down when idle.
Question 4: What command shows resource usage of Pods?
- kubectl top pods (Correct answer)
- kubectl get pods
- kubectl logs
- kubectl exec
Correct answer: kubectl top pods
kubectl top pods displays CPU and memory consumption for each Pod, helping identify resource-hungry workloads.
Question 5: What are resource requests in Kubernetes?
- The minimum amount of resources guaranteed to a container (Correct answer)
- Maximum limits
- Optional suggestions
- Network bandwidth settings
Correct answer: The minimum amount of resources guaranteed to a container
Resource requests define the minimum amount of CPU and memory a container is guaranteed. The scheduler uses requests to decide which node can accommodate the Pod.
Question 6: What tool provides detailed cluster logging in Kubernetes?
- kubectl logs for individual Pods, plus cluster-level solutions like EFK stack (Correct answer)
- Only system logs
- Browser console
- Email notifications
Correct answer: kubectl logs for individual Pods, plus cluster-level solutions like EFK stack
kubectl logs retrieves Pod-level logs, while cluster-wide logging typically uses solutions like EFK (Elasticsearch, Fluentd, Kibana) or Loki for aggregated log management.
What command shows CPU and memory usage of nodes in Kubernetes?