Skip to main content
So what’s actually running in Bob’s cluster right now? The quickest way to find out is to ask the cluster itself. Bob opens the lab terminal and lists pods in the default namespace:
A pod is one or more containers that Kubernetes starts and manages as a single unit. The cluster returns one line: a single pod named app, status Running. There is no Elasticsearch, no Fluentd, and no Kibana — just the application doing its job.
What does that pod actually do? Bob inspects the app’s output with kubectl logs (same namespace). Lines stream down the terminal; each one shows a timestamp and a username — two fields you’ll commonly search by when troubleshooting.
Where do those lines actually go? They go to two places:
  • stdout/stderr — which is why kubectl logs can display them.
  • a folder on the node — the pod in this lab mounts a directory from the node into the container using a hostPath volume. That node-local folder is exactly where a log collector (like Fluentd) will read from.
Example snippet from the pod manifest showing the mount:
A hostPath volume is node-local. If the pod is rescheduled to another node, data stored on this hostPath will not move with it. For durable, cluster-wide log storage, use a centralized collector and persistent stores rather than relying on hostPath alone.
Everything Bob just saw is tied to this one pod on one node. If Kubernetes replaces the app pod right now, the local files (and the previous pod’s kubectl logs output) will be lost — kubectl logs would then show output from the new pod only. Which tools will keep logs safe, searchable, and available across the cluster? Quick overview of the components Bob will use and their roles:
Use a Deployment to ensure the desired number of pod replicas and to enable rolling updates and rollbacks.
Fluentd’s role and configuration Fluentd aggregates logs from many sources into a single stream and can filter, parse, and reshape log lines using plugins. Its primary configuration format is a fluent.conf file (not YAML), although on Kubernetes you typically store that .conf in a ConfigMap.
A slide titled "Settings, Plugins, a Buffer" showing the Fluentd logo and two file icons: one labeled "fluent.conf" and another "fluent.yaml" crossed out. It suggests using a .conf file for Fluentd rather than a .yaml file.
Filtering or transforming log lines is accomplished with plugins referenced inside fluent.conf. If Elasticsearch becomes slow or temporarily unreachable, Fluentd buffers events (in memory or on disk depending on your buffer settings) and forwards them once the downstream becomes available. Buffer configuration controls whether logs are kept in memory or persisted to disk during outages. Elasticsearch fundamentals Elasticsearch stores each log line as a document in a schema-flexible, document-oriented datastore. That design makes indexing and querying logs efficient and flexible.
A dark slide titled "One Line, One Document" showing a smiling blue mascot with a "USER1 logged in" message on the left and a partially filled cylindrical database icon on the right. The KodeKloud logo is visible in the bottom-left corner.
Durability: replication and shards Elasticsearch avoids data loss by keeping replica copies of documents on other nodes. To scale and keep queries fast as data grows, it splits indices into shards and searches them in parallel. Replica shards also help serve read requests.
An infographic titled "Copies and Shards" showing three identical blue robot-like icons on separate server platforms, with the left platform also containing a stacked database cylinder to illustrate replication. The KodeKloud logo is visible in the bottom-left.
Cluster coordination: the master node An elected master node coordinates cluster-wide actions in Elasticsearch: creating indices, assigning shards, tracking node membership, and enforcing allocation rules for shard placement.
A diagram titled "The Master Node" showing a left-side master node connecting to three blue server nodes, each with a stacked-database icon numbered 1, 2, and 3.
Shard allocation and placement rules determine how Elasticsearch distributes shards across nodes to balance load and ensure fault tolerance. Two questions Bob must resolve next
  • If the app pod is replaced right now, where would that USER1 logged in line end up?
  • Where should log data live so it is safe, searchable, and available across the cluster?
Next steps in the lab will show how to deploy Fluentd, Elasticsearch, and Kibana in Kubernetes so logs from node-local hostPath folders are collected, indexed, and made searchable cluster-wide. Links and references

Watch Video

Practice Lab