Parallel Deployments
By default, Release deploys charts, services, and jobs serially. This is good if B depends on A and C depends on B. But this default serial process can also be very slow: even a series of 30 second deployments can add up to several minutes if executed serially. Hence, we allow for a workflow to be broken up into steps and each step can run tasks in parallel. Let's see how that works.


Steps run sequentially, because you might want to setup your prerequisites first, then deploy some dependent services or databases, then run some more jobs and services after that. The steps break your workflow into serial dependent steps, just like the default workflows.


Tasks are grouped together under steps and each step can run in parallel as long as there are no interdependencies between tasks in a step.


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.


You may not want to wait for a task to succeed completely before moving on. This might be the case where a frontend takes a long time to deploy and has no particular dependencies in the steps as long as it finishes within a reasonable time. In that case, you can start the task in an earlier step and use the wait_for_finish: false key to let it run in parallel with the other steps.

A Diagram to Look at

You can visualise the following workflow definition as follows:
- name: setup
- step: frontend
tasks: [services.frontend]
wait_for_finish: false
- step: migrate
tasks: [jobs.migrate, jobs.scrub]
halt_on_error: true
- step: backend
tasks: [services.backend]