GithubHelp home page GithubHelp logo

aleimu / pdebug Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 10 KB

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 -'

Go 100.00%

pdebug's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.