Viewing logs
Kernel messages can be retrieved withtalosctl dmesg command:
talosctl logs command:
talosctl logs -k command:
If some host workloads (e.g. system extensions) send syslog messages, they can be retrieved with talosctl logs syslogd command.
Sending logs
Service logs
You can enable logs sendings in machine configuration:json_lines:
msg, talos-level, talos-service, and talos-time fields are always present; there may be additional fields.
Every message sent can be enhanced with additional fields by using the extraTags field in the machine configuration:
extraTags are added to every message sent to the destination verbatim.
syslog is considered a service in Talos, and so messages/logs sent to syslog (e.g., by system extensions) are considered
service logs and will be sent to any configured remote receivers without further configuration.
Kernel logs
Kernel log delivery can be enabled with thetalos.logging.kernel kernel command line argument, which can be specified
in the .machine.installer.extraKernelArgs:
json_lines.
Sample message:
extraKernelArgs in the machine configuration are only applied on Talos upgrades, not just by applying the config.
(Upgrading to the same version is fine).
Filebeat example
To forward logs to other Log collection services, one way to do this is sending them to a Filebeat running in the cluster itself (in the host network), which takes care of forwarding it to other endpoints (and the necessary transformations). If Elastic Cloud on Kubernetes is being used, the following Beat (custom resource) configuration might be helpful:hostNetwork: true in the daemonSet configuration.
This ensures filebeat uses the host network, and listens on 127.0.0.1:12345
(UDP) on every machine, which can then be specified as a logging endpoint in
the machine configuration.
Fluent-bit example
First, we’ll create a value file for thefluentd-bit Helm chart.
talosctl edit mc.