debugging kubernetes (Delve and Goland)

1. Build from source

cd GOPATH

mkdir k8s.io

cd k8s.io

git clone https://github.com/kubernetes/kubernetes.git

Note : make the location of sure source code at $GOPATH/k8s.io/kubernetes

example :

GOPATH/src/github.com/xuchencn/xxxx

GOPATH/src/k8s.io/kubernetes

cd $GOPATH/k8s.io/kubernetes

make

After make find cmds on "_output/bin/"

2.Install delve

Follow the delve's toturial to install delve

After install you can debugging use delve or use Goland

3.Debugging by Goland

Example by apiserver

cd $GOPATH/src/k8s.io/kubernetes/cmd/kube-apiserver/

$GOPATH/bin/dlv debug --headless --listen=:2345 --api-version=2 -- k8s.io/kubernetes/cmd/kube-apiserver/apiserver.go --etcd-servers http://localhost:2379

After the command delve will output a "debug" file in current directory and listen on 2345 port

Open Goland create new remote debug

debugging kubernetes (Delve and Goland)

Don't forget create breakingpoints before debugging

debugging kubernetes (Delve and Goland)

上一篇:Eclipse 出现项目没有错但是项目名称却有红色感叹号或者红叉的解决办法


下一篇:Javaweb学习笔记——(二十三)——————AJAX、XStream、JSON