Remote debug Istio controlplane with delve in VSCODE
- Clone the istio repo
- Update the docker filewith ‘devle’ following the istio wiki
- Build image with debug enabled following the mentioned wiki as well. The github action can help if there is no container runtime in local to build.
- Update the image to the istiod deployment and update the ‘
readOnlyRootFilesystem
’ to ‘false’ - Build tunnel with ‘port-forward’ between local and the istiod pod at port 40000
- Configure the ‘.vscode/launch.json’ like below in the local istio repo if the image is built with github action. May need to add ‘substitutePath’ if necessary.
- Insert the ‘breakpoints’ in the code and launch the ‘debugging’
Download URL:
- Input the “name” of the pod and “namespace” of the pod to the “xxx.json”. Example is “example/test.json”
- Run “./k8sTcpdump -p xxx.json” and it will bring up pods on the corresponding nodes to capture the network traces of the target pods. The ‘.cap’ file will be downloaded to the current folder.
You could refer to the GIF https://github.com/Shuanglu/k8sTcpdump/blob/main/doc/k8sTcpdump.gif as well