Errors are typically ignored during tasks because Kubernetes can automatically restart and keep trying until a service succeeds. As an example, if you mistakenly run service B before service A that it depends on, service B may fail to start. However, Kubernetes will retry service B again and if service A is now functioning, then service B will start properly. This may not be the behaviour you want, however. For example, a critical job in a task might be critical to some further dependency in the tasks or steps, and you might want the whole chain to fail as soon as a failure is detected. In that case, you can use the halt_on_error: true
key to stop the stage and abort the deployment. Any successful services or jobs started in a previous step
or task
will still be running or have run, though, so think carefully about how you want to clean up on the next run.