首页 > Web开发 > 详细

debugging kubernetes (Delve and Goland)

时间:2018-08-01 13:37:03      阅读:244      评论:0      收藏:0      [点我收藏+]

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

技术分享图片

 

debugging kubernetes (Delve and Goland)

原文:https://www.cnblogs.com/xuchenCN/p/9400377.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!