Skaffold Debugging with IntelliJ

Skaffold/Kustomize Debugging

  • Instead of starting a service by running skaffold dev, run skaffold debug, as this will expose port 5005 for the remote debugger to connect to.

Screenshot 2024 11 12 at 10.49.59 AM

  • When the service has started and the port is open you will see output similar to this:

Screenshot 2024 11 12 at 10.52.44 AM

  • In IntelliJ, click on Run and then on Edit Configurations.

Screenshot 2024 11 12 at 10.52.12 AM

  • Click on the + icon and create a new Remote JVM Debug, make sure the port is 5005 and is what matches the output you saw earlier.

Screenshot 2024 11 12 at 10.52.54 AM

  • Now, click on Run and then Debug Unnamed.

Screenshot 2024 11 12 at 10.53.06 AM

You can now set breakpoints in your actual code, and when you run an integration test, your breakpoint will be hit. Keep in mind the difference between unit tests and integration tests, and also understand that you can set breakpoints within your code and also breakpoints within your integration tests.

Connecting to oracle-db in Skaffold

  • You will want to run skaffold dev --port-forward=true or skaffold debug --port-forward=true to enable port forwarding for all dependent services.

  • Here is an example of the IntelliJ database configuration to connect to a service:

connection info