Skip to content

Commit 1b2d59b

Browse files
Sebbo92dchaykin
authored andcommitted
Should be an interesting story...
1 parent 5ef0ee1 commit 1b2d59b

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
# Preface
22

3-
In this article we want to show you how it´s possible to remote debug a go service in a kubernetes cluster.
3+
In a perfect world every written service will work smooth, your test coverage is on top and there are no bugs in your API. But we all know, that we can´t achieve this world, sadly. It´s not unusual that there´s a bug in an API and you have to debug this problem in a production environment. We have faced this problem with our go services in our kubernetes cluster and we want to show you how it´s possible to remote debug a go service in a kubernetes cluster.
44

55
## Software Prerequisites
66

7-
1. Docker Desktop: <https://docs.docker.com/get-docker/> (used version: 19.03.8)
8-
2. kind (Kubernetes in Docker): <https://kind.sigs.k8s.io.> (used version: v0.7.0) We decided to use kind instead of minikube, since it is a very good tool for testing kubernetes locally.
9-
3. Kubectl: <https://kubernetes.io/de/docs/tasks/tools/install-kubectl/> (used version: 1.17.2)
10-
4. Visual Studio Code: <https://code.visualstudio.com/download> (used version: 1.32.3)
7+
For this scenario we need some software:
8+
9+
* Docker Desktop: <https://docs.docker.com/get-docker/> (used version: 19.03.8)
10+
* kind (Kubernetes in Docker): <https://kind.sigs.k8s.io.> (used version: v0.7.0)
11+
* Kubectl: <https://kubernetes.io/de/docs/tasks/tools/install-kubectl/> (used version: 1.17.2)
12+
* Visual Studio Code: <https://code.visualstudio.com/download> (used version: 1.32.3)
13+
14+
We decided to use `kind` instead of `minikube`, since it´s a very good tool for testing kubernetes locally and we can use our docker images without a docker registry.
1115

1216
## Big Picture
1317

1418
First we will briefly explain how it works:
1519

20+
1. We create a new kubernetes cluster `local-debug-k8s` on our local system
21+
1622
* you need a docker container with delve (<https://github.com/go-delve/delve>) as main process
1723
* delve needs access to the path with the project data. This is done by mounting `$GOPATH/src` on the pod which is running in the kubernetes cluster
1824
* we start the delve container on port 30123 and bind this port to localhost, so that only our local debugger can communicate with delve

0 commit comments

Comments
 (0)