Skip to content

Debugging a stack application

Scott Kurz edited this page Apr 30, 2021 · 2 revisions

Debugging your application

  1. Push your app in "debug" mode

    odo push --debug
    

    Note: The default odo debug port 5858 will be used.

  2. Setup port forwarding from your cluster to your local workspace

    Using odo:

    odo debug port-forward
    

    A specific local port can be specified with the --local-port flag

    Using kubectl:

    kubectl port-forward <pod_name> 5858:5858
    
  3. Connect a debugger to localhost:5858 (or whatever local port you forwarded to)

Debugging application tests

  1. Add -Dmaven.failsafe.debug to test command

  2. Push your app to your cluster

    odo push
    
  3. Forward the Maven default debug port (5005) from your cluster to your local workspace

    kubectl port-forward <pod_name> 5005:5005
    
  4. Run your tests

    odo test --show-log
    
  5. Connect a debugger to localhost:5005