Implementing DevOps Solutions and Practices Using Cisco Platforms (DEVOPS) — Question 29
Which step must be taken to enable centralized logging in a Kubernetes environment?
Answer options
- A. No steps need to be taken. The master node automatically aggregates logs from all worker nodes and stores them on the specified persistent volume.
- B. Create a CustomResourceDefinition in each deployment that specifies the IP or names the log collector.
- C. Deploy a sidecar node that aggregates logs from the entire cluster.
- D. Create a DaemonSet that deploys a container with a logging agent on every node in the cluster.
Correct answer: C
Explanation
The correct answer is D because a DaemonSet ensures that a logging agent runs on every node, facilitating the collection of logs from all pods. Option A is incorrect as logs are not automatically aggregated without configuration. Option B is not suitable since a CustomResourceDefinition does not handle logging by itself. Option C is also wrong because a sidecar node would not provide comprehensive logging across the entire cluster as effectively as a DaemonSet.