Skip to content
/ pdebug Public

For daily positioning pods in which the application cannot start or want to copy a pod by itself, support Deployment/StatefulSet/Job/Pod resources, you can input json/yaml format from a file or console and specify the output json/yaml format for 'kubectl apply -f -'

Notifications You must be signed in to change notification settings

aleimu/pdebug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pod debug工具

用于日常定位pod中应用无法启动或者想自己copy一个pod,支持Deployment/StatefulSet/Job/Pod资源,可以从文件或控制台输入json/yaml格式并指定输出json/yaml格式用于kubectl apply -f - ,生成的pod会被sh -c /usr/sbin/sshd -D & touch debug && tail -f debug阻塞住从而不退出

使用

kubectl get deployment/xxx -o json |pdebug | kubectl apply -f -
kubectl get statesulset/xxx -o json |pdebug | kubectl apply -f -
kubectl get pod/xxx -o json |pdebug | kubectl apply -f -
kubectl get job/xxx -o json |pdebug | kubectl apply -f -
cat pod.yaml |pdebug | kubectl apply -f -
pdebug -f pod.json| kubectl apply -f -
pdebug -f pod.json -t yaml

打包

go mod tidy
go build -o pdebug -ldflags="-s -w" main.go
go build -mod=mod
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o pdebug.exe -ldflags="-s -w" main.go
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go

About

For daily positioning pods in which the application cannot start or want to copy a pod by itself, support Deployment/StatefulSet/Job/Pod resources, you can input json/yaml format from a file or console and specify the output json/yaml format for 'kubectl apply -f -'

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages