Skip to content

How to implement multiple debug containers on a single k8s node? #162

Open
@moluzhui

Description

@moluzhui

Because multiple users are simultaneously using kube-debug to debug different pods, during the testing process, it was found that if the pods being debugged are on the same node, an error will occur and the connection cannot be established. Can this issue be resolved?

# kubectl debug -n test <second_pod_in_same_debug_node>
2025/02/12 16:03:39 Getting user name from default context 'context-kubernetes'
2025/02/12 16:03:39 User name 'admin' received from context
Agent Pod info: [Name:debug-agent-pod-de143442-e917-11ef-9a38-0cc47a07c582, Namespace:default, Image:debug-agent:latest, HostPort:10027, ContainerPort:10027]
Waiting for pod debug-agent-pod-de143442-e917-11ef-9a38-0cc47a07c582 to run...
Error occurred while waiting for pod to run:  pod ran to completion
the agentPod is not running, you should check the reason and delete the failed agentPod and retry.
error: pod ran to completion

The status of the second debug-agent is as follows:

default         debug-agent-pod-de143442-e917-11ef-9a38-0cc47a07c582   0/1     NodePorts          0          18s      <none>         <node_name>   <none>           <none>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions