Prerequisites
Before you begin, ensure you have:- An active CoreWeave account.
kubectlinstalled locally.- A Kubeconfig with access to the desired Node.
About debug Pods
To connect to a Node, you create a debug Pod that runs on the Node you want to troubleshoot. The debug Pod lets you interact with the Node’s filesystem and network interfaces, and run diagnostic commands such asip, ifconfig, nc, ping, and ps. You can install additional tools, such as mtr, tcpdump, and curl, using the Node’s package manager. When you use a debug Pod, keep the following in mind:
kubectl debugautomatically creates a new Pod name based on the Node name.- The root filesystem of the Node is mounted at
/host. - Debug Pods aren’t privileged, so commands such as
chroot /hostthat are restricted to superusers fail. If you need a privileged Pod, create it manually or use the--profile=sysadminflag. - You can set specific properties such as securityContext on a debug Pod by applying Debugging Profiles.
Connect to a Node
To connect to a Node, usekubectl debug node. The following example creates a debug Pod on a Node named mynode with the ubuntu image and an interactive shell:
Command-line explanation
kubectl debug node/mynode: Create a debug Pod on the Node namedmynode.-i: Keep stdin open on the container in the Pod, even if nothing is attached.-t: Allocate a TTY for the debug container.--image=ubuntu: Use the Ubuntu container image for the debug Pod.
Clean up
When you no longer need the debug Pod, delete it. First, list your Pods to find the debug Pod’s name:More options
kubectl debug node offers many other command-line options to customize the debug Pod’s namespace, container name, and image. You can also issue commands to the Pod or copy an existing Pod’s configuration. Use --help for a full list of options with examples: