码迷,mamicode.com
首页 > Web开发 > 详细

debugging kubernetes (Delve and Goland)

时间:2018-08-01 14:25:48      阅读:355      评论:0      收藏:0      [点我收藏+]

标签:The   out   location   uber   bre   ati   cat   listen   mds   

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)

标签:The   out   location   uber   bre   ati   cat   listen   mds   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!