Observability and troubleshooting, topic 47 of 61
Logs
Containers should write logs to stdout and stderr; the runtime stores them on the node, and kubectl logs reads them, with --previous for the container that just crashed. They go when the Pod is deleted or the node rotates them.
To keep them, a DaemonSet agent such as Fluent Bit or Vector reads each node's logs and ships them to a store such as Loki or Elasticsearch. Write structured logs, one JSON object a line, and they become far easier to search.
On Opsfolk
Nothing of ours for this topic yet: an article is on its way.
Elsewhere
- Logging architectureOfficial