Skip to main content
Talos Linux is a minimal operating system designed to run Kubernetes workloads efficiently and securely. However, there are cases where you need access to the underlying system for troubleshooting or diagnostics. Some troubleshooting tasks require tools that are not included in the default Talos image — nor should they be, since they aren’t needed for normal cluster operation. Talos provides a debug shell that starts a privileged container using an image you supply, then drops you into that shell. When you exit, the container is removed and the cluster continues operating normally. There are two ways to bring the container image to use for the debug shell:
  • let the Talos machine pull the image from the registry;
  • push the image to the machine using the API.
Pulling from a registry is the simplest approach, but requires network access to that registry. If you are troubleshooting a connectivity issue, use the API to push the image directly to the machine instead. asciicast

Pulling the image from the registry

Pass the image reference as an argument to talosctl debug:

Pushing the debug image to the machine

First, build the image required (e.g. install required packages):
Note: if you have the image already built and stored in your local Docker image store, you can skip the build step and directly save it to a tarball.
Then, build the image and store it to the local Docker image store:
Next, save the image to a tarball:
Note: the architecture of the image should match the architecture of the machine to debug, otherwise the image will fail to start.
Finally, pass the tarball path to talosctl debug:

Anatomy of the debug container

The debug container runs privileged with host PID and network namespaces, giving it access to the host’s processes and network interfaces. The host filesystem is mounted at /host, so you can browse host files from within the container. Host devices are available under the regular /dev path.

Example: using pwru (packet-where-are-you) tool

The pwru tool traces network packets through the Linux network stack, making it useful for diagnosing network issues. First, build the pwru image from source, since it is not available in public container registries:
Second, pwru needs to decode function names from kernel pointers, which Talos restricts by default. Temporarily relax this restriction by applying the following machine configuration patch:
Finally, use the pwru image to start the debug shell:
As an example, suppose a firewall rule is blocking access to port 5005 and you want to diagnose it with pwru.
Attempting to reach port 5005 from outside the cluster results in a silent block:
Back in the pwru debug shell, launch the pwru tool to trace the packets to port 5005:
The sk_skb_reason_drop(SKB_DROP_REASON_NETFILTER_DROP) entry shows the packet being dropped by netfilter — the Linux kernel’s firewall framework. This confirms the issue lies in the firewall rules on the machine, and further investigation should focus there.