aylei / aylei/kubectl-debug

How to run one-time run command and get result

Open
#78 4 comments 0 reactions 0 assignees View on GitHub
bug enhancement
Dominant language
Go
Stars
2.3k
Forks
303
PR merge metrics
No merged PRs in 30d

Description

By running the command "kubectl exec -ti", we can get the output of the command result as follow; Using "kubectl-debug" can not get the desired result, Any Idea?

```bash
# kubectl exec -ti tkservice-5ffbb64854-6k2h6 -- ls -hl
total 30M
-rw-r--r-- 1 root root 263 Oct 31 09:59 Dockerfile
drwxr-xr-x 7 root root 4.0K Oct 31 09:59 config
-rw-r--r-- 1 root root 188 Oct 31 09:59 main.yml
```

```bash
# kubectl-debug tkservice-5ffbb64854-6k2h6 -- ls -hl
Agent Pod info: [Name:debug-agent-pod-146dc5f3-fc7d-11e9-a689-00163e03e155, Namespace:default, Image:debug-agent:latest, HostPort:10027, ContainerPort:10027]
Waiting for pod debug-agent-pod-146dc5f3-fc7d-11e9-a689-00163e03e155 to run...
pod tkservice-5ffbb64854-6k2h6 PodIP 10.81.133.178, agentPodIP 172.xxx.xxx.211
wait for forward port to debug agent ready...
Forwarding from 127.0.0.1:10027 -> 10027
Handling connection for 10027
pulling image netshoot...
latest: Pulling from paas-dev/netshoot
Digest: sha256:8b020dc72d8ef07663e44c449f1294fc47c81a10ef5303dc8c2d9635e8ca22b1
Status: Image is up to date for netshoot:latest
starting debug container...
container created, open tty...
Start deleting agent pod tkservice-5ffbb64854-6k2h6
end port-forward...
```

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names kubectl-debug and the kubectl exec comparison but no repository file or test. Start by reproducing both commands and tracing the one-time command entry point; done means kubectl-debug returns the executed command's output instead of only debug-agent and container startup logs.

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
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.