Kubernetes Container Orchestration Monitoring and Logging 4 — Questions and Answers
Question 1: What does a Prometheus Alertmanager 'silences' feature allow you to do?
- Suppress specific alerts for a defined time period (Correct answer)
- Permanently disable an alerting rule
- Route alerts to a different receiver
- Delete historical alert data
Correct answer: Suppress specific alerts for a defined time period
Alertmanager silences let you mute matching alerts for a specified duration, useful during planned maintenance windows.
Question 2: Which metric type in Prometheus represents a value that can go up and down, such as the number of active connections?
- Gauge (Correct answer)
- Counter
- Histogram
- Summary
Correct answer: Gauge
A Gauge metric represents a value that can increase or decrease over time, making it suitable for measuring current state like active sessions.
Question 3: In Kubernetes, where are container logs stored on the node filesystem by default?
- /var/log/containers/ (Correct answer)
- /etc/kubernetes/logs/
- /tmp/container-logs/
- /var/lib/kubelet/logs/
Correct answer: /var/log/containers/
Kubernetes symlinks container logs to `/var/log/containers/` on the node, pointing to the actual log files managed by the container runtime.
Question 4: What is the purpose of a Prometheus 'recording rule'?
- Pre-compute expensive queries and store results as new metrics (Correct answer)
- Record when alerts are triggered
- Store raw metrics to long-term storage
- Log PromQL query history
Correct answer: Pre-compute expensive queries and store results as new metrics
Recording rules evaluate PromQL expressions on a schedule and store the results as new time series, reducing query load on dashboards.
Question 5: Which kubectl command streams live logs from all containers in a pod?
- kubectl logs <pod> --all-containers -f (Correct answer)
- kubectl logs <pod> --stream all
- kubectl tail <pod> -a
- kubectl watch logs <pod>
Correct answer: kubectl logs <pod> --all-containers -f
The `--all-containers` flag combined with `-f` streams live logs from every container in the specified Pod simultaneously.
Question 6: In a Kubernetes cluster, what does a high value of `kube_pod_container_status_restarts_total` indicate?
- A container is crash-looping or repeatedly failing (Correct answer)
- Too many pods are being scheduled
- Node memory is exhausted
- The container image is being pulled frequently
Correct answer: A container is crash-looping or repeatedly failing
A rising `kube_pod_container_status_restarts_total` counter indicates a container is being restarted repeatedly, signaling instability or crashes.
Question 7: Which component in the Kubernetes architecture exposes per-container resource usage metrics that cAdvisor collects?
- kubelet (Correct answer)
- kube-proxy
- kube-scheduler
- etcd
Correct answer: kubelet
cAdvisor is embedded within the kubelet and exposes container resource usage metrics via the kubelet's `/metrics/cadvisor` endpoint.
What does a Prometheus Alertmanager 'silences' feature allow you to do?