DEV Community

Discussion on: How to debug an Argo Workflow

Collapse
 
fuzznaut profile image
fuzznaut • Edited

Good article! I have something to add which helps me a lot in debugging workflows.

Often times I need to get a shell inside the main pod of the stage I'm trying to debug. To do this I temporarily replace/add the command field of that workflow container to an infinite command like tail -f /dev/null or sleep infinity and submit the workflow.

Now the workflow will get stuck in the stage running the infinite command and I'm free to exec into the main container of that pod with something like kubectl -n argo exec -itc main <pod_name> -- bash (replace bash with any other command that your container can run).

After this, I can manually run the code the stage was intended to run with an interactive debugger or explore how the container environment is setup. This is useful when your code depends on artifacts that were produced on past stages or for debugging directly on the environment that is giving problems.