Where does Kubernetes typically store container logs on the node by default?
Think about where Docker or container runtimes write logs on the host.
Kubernetes stores container logs in the /var/log/containers directory on the node by default. This directory contains symlinks to the actual log files managed by the container runtime.
What is the output of the command kubectl logs my-pod if the pod has a container that writes 'Hello World' to stdout?
This command shows the container's standard output logs.
The kubectl logs command fetches the logs from the container's stdout and stderr streams. If the container wrote 'Hello World', that text will appear as output.
Which configuration snippet correctly deploys Fluentd as a DaemonSet to collect logs from all nodes?
DaemonSets run one pod per node to collect logs from all nodes.
Option B correctly defines a DaemonSet with a container mounting the host's /var/log directory to collect logs from all nodes. Other options use Pod, Deployment, or StatefulSet which do not guarantee one pod per node.
You notice that kubectl logs returns empty output for a pod, but the application writes logs to stdout. What is the most likely cause?
Think about where logs come from when you run kubectl logs.
kubectl logs fetches logs from the container runtime's log files. If the runtime is not writing logs properly, the command returns empty output even if the app writes to stdout.
Arrange the steps in the correct order to set up centralized logging for a Kubernetes cluster using Fluentd and Elasticsearch.
Think about creating a clean space first, then collecting logs, storing them, and finally visualizing.
First create a namespace to organize logging components (3). Then deploy Fluentd as a DaemonSet to collect logs (2). Next deploy Elasticsearch to store logs (1). Finally set up Kibana to visualize logs (4).