Sub Steps

This section describes how to use sub steps in KubeVela.

There is a special step type step-group in KubeVela workflow where you can declare sub-steps when using step-group type steps.

Sub Steps - 图1note

In the version less or equal than v1.4.x, sub steps in a step group are executed concurrently.

In version 1.5+, you can specify the execution mode of steps and sub-steps.

Apply the following example:

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: sub-success
  5. spec:
  6. components:
  7. - name: express-server1
  8. type: webservice
  9. properties:
  10. image: crccheck/hello-world
  11. - name: express-server2
  12. type: webservice
  13. properties:
  14. image: crccheck/hello-world
  15. - name: express-server3
  16. type: webservice
  17. properties:
  18. image: crccheck/hello-world
  19. workflow:
  20. steps:
  21. - name: step1
  22. type: apply-component
  23. properties:
  24. component: express-server1
  25. - name: step2
  26. type: step-group
  27. subSteps:
  28. - name: step2-sub1
  29. type: apply-component
  30. properties:
  31. component: express-server2
  32. - name: step2-sub2
  33. type: apply-component
  34. properties:
  35. component: express-server3

By default, steps are executed sequentially, so step2 is not executed until step1 is deployed. Whereas in the step-group, sub-steps will be executed concurrently by default, so step2-sub1 and step2-sub2 will be deployed at the same time.