You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-12Lines changed: 14 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -167,22 +167,22 @@ A message appears indicating that the docker image did not exist before:
167
167
Image: "setlog/debug-k8s:latest" with ID "sha256:944baa03d49698b9ca1f22e1ce87b801a20ce5aa52ccfc648a6c82cf8708a783" not present on node "local-debug-k8s-worker"
168
168
```
169
169
170
-
### Starting the delve server in the cluster
170
+
### Deploy the delve container in our cluster
171
171
172
-
Now we want to create a persistent volume and its claim in order to mount the project path into the worker node:
172
+
First of all we need a persistent volume and its claim in order to mount the project path into the node:
173
173
174
174
```sh
175
175
kubectl create -f cluster/persistent-volume.yaml
176
176
```
177
177
178
178
The interesting part here is:
179
179
180
-
```
180
+
```yaml
181
181
hostPath:
182
182
path: /go/src
183
183
```
184
184
185
-
Let's take a look at the full chain of mounting the local project path into the pod, since you want probably to adjust them to your environment:
185
+
Below is an image that shows the configurations through which our local path is mounted. In your environment it could be another path:
186
186
187
187

188
188
@@ -195,22 +195,23 @@ kubectl get pvc
195
195
go-pvc Bound go-pv 256Mi RWO hostpath 51s
196
196
```
197
197
198
-
You are ready to start the service in debug mode:
198
+
Now we are ready to deploy all our services in debug mode:
199
199
200
200
```sh
201
201
kubectl create -f cluster/deploy-service.yaml
202
202
```
203
203
204
-
Let's go through the deployment.
204
+
Let's go through the pod manifest:
205
205
206
-
* Image name is what we loaded into the kind cluster with the command `kind load image...`. _imagePullPolicy_ must be set to _IfNotPresent_, because it is already loaded, we don't want Kubernetes to try loading it again.
206
+
*_image_ is the previously built and loaded image into the kind cluster with `kind load image...`
207
+
*_imagePullPolicy_ must be set to _IfNotPresent_ because it's already loaded and we don't want Kubernetes to try it again
207
208
208
209
```yaml
209
210
image: setlog/debug-k8s:latest
210
211
imagePullPolicy: IfNotPresent
211
212
```
212
213
213
-
* We use the persistent volume claim to mount the project path into the pod and make`/go/src` to be linked with `${GOPATH}/src` on your computer:
214
+
* We use the persistent volume claim to mount the project path into the pod, so that`/go/src` will be linked to `${GOPATH}/src` on your local system
214
215
215
216
```yaml
216
217
containers:
@@ -223,16 +224,16 @@ Let's go through the deployment.
223
224
- name: go-volume
224
225
persistentVolumeClaim:
225
226
claimName: go-pvc
226
-
````
227
+
```
227
228
228
-
* As there might be several workers in your cluster, we deploy the pod on the one, that is labelled with _debug=true_. The docker image _setlog/debug-k8s_ has been loaded earlier in it already.
229
+
* As there might be several nodes in your kubernetes cluster, we deploy the pod on the node, that is labelled with _debug=true_. The docker image _setlog/debug-k8s_ was already loaded on this node.
229
230
230
231
```yaml
231
232
nodeSelector:
232
233
debug: "true"
233
234
```
234
235
235
-
* Service _service-debug_ has the type _NodePort_ and is mounted into the worker node. This port 30123 is equal to the parameter _--listen=:30123_ in the Dockerfile, which makes it possible to send debug commands to the delve server.
236
+
* Service _service-debug_ has the type _NodePort_ and is mounted to the node. This port 30123 is equal to the parameter _--listen=:30123_ in the Dockerfile, which makes it possible to send debug commands to the delve server.
236
237
237
238
* Service _debug-k8s_ will be connected to the ingress server in the final step. It serves for exposing the API endpoints we are going to debug.
238
239
@@ -255,7 +256,8 @@ Usually it takes a couple of seconds to start the debugging process with delve.
255
256
Also, you can output logs of the pod by performing `kubectl logs $PODNAME` in order to make sure the delve API server is listening at 30123.
0 commit comments