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

 

 Don't forget create breakingpoints before debugging

 

转载于:https://www.cnblogs.com/xuchenCN/p/9400377.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值