Home > other >  Debugging NodeJs app running inside pod on Kind (Kubernetes in docker) cluster
Debugging NodeJs app running inside pod on Kind (Kubernetes in docker) cluster

Time:02-21

I am running a kubernetes cluster with enter image description here

And these are the settings under the Docker container settings label:

enter image description here

Any suggestions or workarounds in order to accomplish this would be more than appreciated.

Thank you in advance!

CodePudding user response:

Finally I managed to connect the remote debugger by following the steps described bellow:

  1. Start the node process inside the pod with the --inspect-brk arg in order to be able to attach a debugger. (E.g. node --inspect-brk --loader ts-node/esm src/server.ts)
  2. Then I forwarded the debug port from the pod to my local computer by running the command kubectl port-forward deploy/application-deployment 9229:9229
  3. Finally I created an Attach to Node.js/Chrome run/debug configuration on WebStorm instead of the Node.js configuration as I tried on the beginning and everything worked like a charm.

This linked helped me configure the described solution.

  • Related