KCNA Monitoring and Logging 2 — Questions and Answers
Question 1: Which Kubernetes object exposes metrics in Prometheus format for cluster-level resource usage?
- kube-state-metrics (Correct answer)
- metrics-server
- node-exporter
- cAdvisor
Correct answer: kube-state-metrics
kube-state-metrics exposes cluster-level metrics about Kubernetes objects (deployments, pods, nodes) in Prometheus format, distinct from resource usage metrics.
Question 2: What is the default log driver used by Docker (and many container runtimes) when no driver is specified?
- syslog
- journald
- json-file (Correct answer)
- fluentd
Correct answer: json-file
The json-file driver is the default Docker log driver, writing container logs as JSON to files on the host filesystem.
Question 3: In a Kubernetes cluster, where are container logs stored on the node by default?
- /var/log/pods/ (Correct answer)
- /etc/kubernetes/logs/
- /tmp/container-logs/
- /run/containerd/logs/
Correct answer: /var/log/pods/
Kubernetes stores container logs under /var/log/pods/ on each node, organized by namespace, pod name, and container name.
Question 4: Which CNCF project provides a vendor-neutral observability framework for generating, collecting, and exporting telemetry data?
- Jaeger
- OpenTelemetry (Correct answer)
- Fluentbit
- Cortex
Correct answer: OpenTelemetry
OpenTelemetry (OTel) is the CNCF standard for instrumenting, generating, collecting, and exporting telemetry (metrics, logs, traces) in a vendor-neutral way.
Question 5: What does the `kubectl top nodes` command rely on to return resource usage data?
- Prometheus
- metrics-server (Correct answer)
- kube-state-metrics
- cAdvisor directly
Correct answer: metrics-server
kubectl top nodes queries the Metrics API, which is typically served by metrics-server aggregating cAdvisor data from each node.
Question 6: Which log aggregation pattern involves running a dedicated logging container alongside the application container in the same pod?
- DaemonSet pattern
- Sidecar pattern (Correct answer)
- Node-agent pattern
- Gateway pattern
Correct answer: Sidecar pattern
The sidecar pattern places a log-forwarding container (e.g., Fluent Bit) in the same pod to collect and ship the application container's logs.
Question 7: In Prometheus, what type of metric would you use to track the total number of HTTP requests served since startup?
- Gauge
- Histogram
- Counter (Correct answer)
- Summary
Correct answer: Counter
A Counter is a monotonically increasing metric ideal for tracking cumulative totals like total HTTP requests, errors, or completed tasks.
Which Kubernetes object exposes metrics in Prometheus format for cluster-level resource usage?