Debugging using devfile
#
Debugging a componentDebugging your component involves port forwarding with the Kubernetes pod. Before you start, it is required that you have a kind: debug
step located within your devfile.yaml
.
The following devfile.yaml
contains a debug
step under the commands
key:
#
Debugging your devfile component via CLIWe will use the official nodejs example in our debugging session which includes the necessary debug
step within devfile.yaml
.
Download the example application:
For example:
Push with the
--debug
flag which is required for all debugging deployments:For example:
NOTE: A custom debug command may be chosen via the
--debug-command="custom-step"
flag.Port forward to the local port in order to access the debugging interface:
For example:
NOTE: A specific port may be specified using the
--local-port
flagOpen a separate terminal window and check if the debug session is running.
For example:
Accessing the debugger: The debugger is accessible through an assortment of tools. An example of setting up a debug interface would be through VSCode's debugging interface.