How to implement multiple debug containers on a single k8s node?
- Dominant language
- Go
- Stars
- 2.3k
- Forks
- 303
- PR merge metrics
- No merged PRs in 30d
Description
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
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
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the failure with two debug sessions targeting pods on one Kubernetes node, starting from the kubectl debug command and the debug-agent pod status shown here. Trace how the second agent pod is created and why it reaches NodePorts/completion; done means both sessions connect successfully without interfering. The repository is marked no longer maintained, so check the linked replacement project before starting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- cli, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100