Built-in WorkflowStep Type

This documentation will walk through all the built-in workflow step types sorted alphabetically.

It was generated automatically by scripts, please don’t update manually, last updated at 2022-07-24T20:59:39+08:00.

Apply-Object

Description

Apply raw kubernetes objects for your workflow steps.

Examples (apply-object)

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: server-with-pvc
  5. namespace: default
  6. spec:
  7. components:
  8. - name: express-server
  9. type: webservice
  10. properties:
  11. image: oamdev/hello-world
  12. port: 8000
  13. volumes:
  14. - name: "my-pvc"
  15. type: "pvc"
  16. mountPath: "/test"
  17. claimName: "myclaim"
  18. workflow:
  19. steps:
  20. - name: apply-pvc
  21. type: apply-object
  22. properties:
  23. # Kubernetes native resources fields
  24. value:
  25. apiVersion: v1
  26. kind: PersistentVolumeClaim
  27. metadata:
  28. name: myclaim
  29. namespace: default
  30. spec:
  31. accessModes:
  32. - ReadWriteOnce
  33. resources:
  34. requests:
  35. storage: 8Gi
  36. storageClassName: standard
  37. # the cluster you want to apply the resource to, default is the current cluster
  38. cluster: <your cluster name>
  39. - name: apply-server
  40. type: apply-component
  41. properties:
  42. component: express-serve

Specification (apply-object)

NameDescriptionTypeRequiredDefault
valueSpecify Kubernetes native resource object to be applied.map[string]:(null|bool|string|bytes|{…}|[…]|number)true
clusterThe cluster you want to apply the resource to, default is the current control plane cluster.stringfalseempty

Depends-On-App

Description

Wait for the specified Application to complete.

Examples (depends-on-app)

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: first-vela-workflow
  5. namespace: default
  6. spec:
  7. components:
  8. - name: express-server
  9. type: webservice
  10. properties:
  11. image: oamdev/hello-world
  12. port: 8000
  13. traits:
  14. - type: ingress
  15. properties:
  16. domain: testsvc.example.com
  17. http:
  18. /: 8000
  19. workflow:
  20. steps:
  21. - name: express-server
  22. type: depends-on-app
  23. properties:
  24. name: another-app
  25. namespace: default

depends-on-app will check if the cluster has the application with name and namespace given in properties. If the application exists, it will hang the next step until the application is running. If the application does not exist, KubeVela will check the ConfigMap with the same name, and read the config of the Application and apply to cluster. The ConfigMap is like below: the name and namespace of the ConfigMap is the same in properties. In data, the key must be specified by application, and the value is the yaml of the deployed application yaml.

  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: myapp
  5. namespace: vela-system
  6. data:
  7. application:
  8. <app yaml file>

Specification (depends-on-app)

NameDescriptionTypeRequiredDefault
nameSpecify the name of the dependent Application.stringtrue
namespaceSpecify the namespace of the dependent Application.stringtrue

Deploy

Description

A powerful and unified deploy step for components multi-cluster delivery with policies.

Examples (deploy)

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: deploy-workflowstep
  5. namespace: examples
  6. spec:
  7. components:
  8. - name: nginx-deploy-workflowstep
  9. type: webservice
  10. properties:
  11. image: nginx
  12. policies:
  13. - name: topology-hangzhou-clusters
  14. type: topology
  15. properties:
  16. clusterLabelSelector:
  17. region: hangzhou
  18. - name: topology-local
  19. type: topology
  20. properties:
  21. clusters: ["local"]
  22. namespace: examples-alternative
  23. workflow:
  24. steps:
  25. - type: deploy
  26. name: deploy-local
  27. properties:
  28. policies: ["topology-local"]
  29. - type: deploy
  30. name: deploy-hangzhou
  31. properties:
  32. # require manual approval before running this step
  33. auto: false
  34. policies: ["topology-hangzhou-clusters"]

Specification (deploy)

NameDescriptionTypeRequiredDefault
policiesDeclare the policies that used for this deployment. If not specified, the components will be deployed to the hub cluster.[]stringfalse
parallelismMaximum number of concurrent delivered components.intfalse5
ignoreTerraformComponentIf set false, this step will apply the components with the terraform workload.boolfalsetrue
autoIf set to false, the workflow will suspend automatically before this step, default to be true.boolfalsetrue

Deploy-Cloud-Resource

Description

Deploy cloud resource and deliver secret to multi clusters.

Specification (deploy-cloud-resource)

NameDescriptionTypeRequiredDefault
envDeclare the name of the env in policy.stringtrue
policyDeclare the name of the env-binding policy, if empty, the first env-binding policy will be used.stringfalseempty

Export2config

Description

Export data to specified Kubernetes ConfigMap in your workflow.

Examples (export2config)

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: export-config
  5. namespace: default
  6. spec:
  7. components:
  8. - name: express-server
  9. type: webservice
  10. properties:
  11. image: oamdev/hello-world
  12. port: 8000
  13. workflow:
  14. steps:
  15. - name: apply-server
  16. type: apply-component
  17. outputs:
  18. - name: status
  19. valueFrom: output.status.conditions[0].message
  20. properties:
  21. component: express-server
  22. - name: export-config
  23. type: export-config
  24. inputs:
  25. - from: status
  26. parameterKey: data.serverstatus
  27. properties:
  28. configName: my-configmap
  29. data:
  30. testkey: testvalue

Specification (export2config)

NameDescriptionTypeRequiredDefault
clusterSpecify the cluster of the config map.stringfalseempty
namespaceSpecify the namespace of the config map.stringfalse
dataSpecify the data of config map.{…}true
configNameSpecify the name of the config map.stringtrue

Export2secret

Description

Export data to Kubernetes Secret in your workflow.

Examples (export2secret)

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: export-secret
  5. namespace: default
  6. spec:
  7. components:
  8. - name: express-server
  9. type: webservice
  10. properties:
  11. image: oamdev/hello-world
  12. port: 8000
  13. workflow:
  14. steps:
  15. - name: apply-server
  16. type: apply-component
  17. outputs:
  18. - name: status
  19. valueFrom: output.status.conditions[0].message
  20. properties:
  21. component: express-server
  22. - name: export-secret
  23. type: export-secret
  24. inputs:
  25. - from: status
  26. parameterKey: data.serverstatus
  27. properties:
  28. secretName: my-secret
  29. data:
  30. testkey: testvalue

Specification (export2secret)

NameDescriptionTypeRequiredDefault
clusterSpecify the cluster of the secret.stringfalseempty
namespaceSpecify the namespace of the secret.stringfalse
typeSpecify the type of the secret.stringfalse
secretNameSpecify the name of the secret.stringtrue
dataSpecify the data of secret.{…}true

Generate-Jdbc-Connection

Description

Generate a JDBC connection based on Component of alibaba-rds.

Specification (generate-jdbc-connection)

NameDescriptionTypeRequiredDefault
nameSpecify the name of the secret generated by database component.stringtrue
namespaceSpecify the namespace of the secret generated by database component.stringfalse

Notification

Description

Send notifications to Email, DingTalk, Slack, Lark or webhook in your workflow.

Examples (notification)

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: first-vela-workflow
  5. namespace: default
  6. spec:
  7. components:
  8. - name: express-server
  9. type: webservice
  10. properties:
  11. image: oamdev/hello-world
  12. port: 8000
  13. traits:
  14. - type: ingress
  15. properties:
  16. domain: testsvc.example.com
  17. http:
  18. /: 8000
  19. workflow:
  20. steps:
  21. - name: dingtalk-message
  22. type: notification
  23. properties:
  24. dingding:
  25. # the DingTalk webhook address, please refer to: https://developers.dingtalk.com/document/robots/custom-robot-access
  26. url:
  27. value: <url>
  28. message:
  29. msgtype: text
  30. text:
  31. context: Workflow starting...
  32. - name: application
  33. type: apply-application
  34. - name: slack-message
  35. type: notification
  36. properties:
  37. slack:
  38. # the Slack webhook address, please refer to: https://api.slack.com/messaging/webhooks
  39. url:
  40. secretRef:
  41. name: <secret-key>
  42. key: <secret-value>
  43. message:
  44. text: Workflow ended.
  45. lark:
  46. url:
  47. value: <lark-url>
  48. message:
  49. msg_type: "text"
  50. content: "{\"text\":\" Hello KubeVela\"}"
  51. email:
  52. from:
  53. address: <sender-email-address>
  54. alias: <sender-alias>
  55. password:
  56. # secretRef:
  57. # name: <secret-name>
  58. # key: <secret-key>
  59. value: <sender-password>
  60. host: <email host like smtp.gmail.com>
  61. port: <email port, optional, default to 587>
  62. to:
  63. - kubevela1@gmail.com
  64. - kubevela2@gmail.com
  65. content:
  66. subject: test-subject
  67. body: test-body

Expected outcome

We can see that before and after the deployment of the application, the messages can be seen in the corresponding group chat.

Specification (notification)

NameDescriptionTypeRequiredDefault
larkPlease fulfill its url and message if you want to send Lark messages.larkfalse
slackPlease fulfill its url and message if you want to send Slack messages.slackfalse
emailPlease fulfill its from, to and content if you want to send email.emailfalse
dingdingPlease fulfill its url and message if you want to send DingTalk messages.dingdingfalse

lark (notification)

NameDescriptionTypeRequiredDefault
urlSpecify the the lark url, you can either sepcify it in value or use secretRef.url-option-0 or url-option-1true
messageSpecify the message that you want to sent, refer to Lark messaging.messagetrue
url-option-0 (notification)
NameDescriptionTypeRequiredDefault
valuethe url address content in string.stringtrue
url-option-1 (notification)
NameDescriptionTypeRequiredDefault
secretRefsecretReftrue
secretRef (notification)
NameDescriptionTypeRequiredDefault
namename is the name of the secret.stringtrue
keykey is the key in the secret.stringtrue
message (notification)
NameDescriptionTypeRequiredDefault
contentcontent should be json encode string.stringtrue
msg_typemsg_type can be text, post, image, interactive, share_chat, share_user, audio, media, file, sticker.stringtrue

slack (notification)

NameDescriptionTypeRequiredDefault
urlSpecify the the slack url, you can either sepcify it in value or use secretRef.url-option-0 or url-option-1true
messageSpecify the message that you want to sent, refer to slack messaging.messagetrue
url-option-0 (notification)
NameDescriptionTypeRequiredDefault
valuethe url address content in string.stringtrue
url-option-1 (notification)
NameDescriptionTypeRequiredDefault
secretRefsecretReftrue
secretRef (notification)
NameDescriptionTypeRequiredDefault
namename is the name of the secret.stringtrue
keykey is the key in the secret.stringtrue
message (notification)
NameDescriptionTypeRequiredDefault
textSpecify the message text for slack notification.stringtrue
blocks(null|[…])false
attachments(null|{…})false
thread_tsstringfalse
mrkdwnSpecify the message text format in markdown for slack notification.boolfalsetrue

email (notification)

NameDescriptionTypeRequiredDefault
contentSpecify the content of the email.contenttrue
fromSpecify the email info that you want to send from.fromtrue
toSpecify the email address that you want to send to.[]stringtrue
content (notification)
NameDescriptionTypeRequiredDefault
bodySpecify the context body of the email.stringtrue
subjectSpecify the subject of the email.stringtrue
from (notification)
NameDescriptionTypeRequiredDefault
addressSpecify the email address that you want to send from.stringtrue
aliasThe alias is the email alias to show after sending the email.stringfalse
passwordSpecify the password of the email, you can either sepcify it in value or use secretRef.password-option-0 or password-option-1true
hostSpecify the host of your email.stringtrue
portSpecify the port of the email host, default to 587.intfalse587
password-option-0 (notification)
NameDescriptionTypeRequiredDefault
valuethe password content in string.stringtrue
password-option-1 (notification)
NameDescriptionTypeRequiredDefault
secretRefsecretReftrue
secretRef (notification)
NameDescriptionTypeRequiredDefault
namename is the name of the secret.stringtrue
keykey is the key in the secret.stringtrue

dingding (notification)

NameDescriptionTypeRequiredDefault
urlSpecify the the dingding url, you can either sepcify it in value or use secretRef.url-option-0 or url-option-1true
messageSpecify the message that you want to sent, refer to dingtalk messaging.messagetrue
url-option-0 (notification)
NameDescriptionTypeRequiredDefault
valuethe url address content in string.stringtrue
url-option-1 (notification)
NameDescriptionTypeRequiredDefault
secretRefsecretReftrue
secretRef (notification)
NameDescriptionTypeRequiredDefault
namename is the name of the secret.stringtrue
keykey is the key in the secret.stringtrue
message (notification)
NameDescriptionTypeRequiredDefault
textSpecify the message content of dingtalk notification.(null|{…})false
msgtypemsgType can be text, link, mardown, actionCard, feedCard.stringfalsetext
link(null|{…})false
markdown(null|{…})false
at(null|{…})false
actionCard(null|{…})false
feedCard(null|{…})false

Read-Object

Description

Read Kubernetes objects from cluster for your workflow steps.

Examples (read-object)

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: read-object
  5. namespace: default
  6. spec:
  7. components:
  8. - name: express-server
  9. type: webservice
  10. properties:
  11. image: oamdev/hello-world
  12. port: 8000
  13. workflow:
  14. steps:
  15. - name: read-object
  16. type: read-object
  17. outputs:
  18. - name: cpu
  19. valueFrom: output.value.data["cpu"]
  20. - name: memory
  21. valueFrom: output.value.data["memory"]
  22. properties:
  23. apiVersion: v1
  24. kind: ConfigMap
  25. name: my-cm-name
  26. cluster: <your cluster name
  27. - name: apply
  28. type: apply-component
  29. inputs:
  30. - from: cpu
  31. parameterKey: cpu
  32. - from: memory
  33. parameterKey: memory
  34. properties:
  35. component: express-server

Specification (read-object)

NameDescriptionTypeRequiredDefault
nameSpecify the name of the object.stringtrue
clusterThe cluster you want to apply the resource to, default is the current control plane cluster.stringfalseempty
apiVersionSpecify the apiVersion of the object, defaults to ‘core.oam.dev/v1beta1’.stringfalse
kindSpecify the kind of the object, defaults to Application.stringfalse
namespaceThe namespace of the resource you want to read.stringfalsedefault

Share-Cloud-Resource

Description

Sync secrets created by terraform component to runtime clusters so that runtime clusters can share the created cloud resource.

Specification (share-cloud-resource)

NameDescriptionTypeRequiredDefault
envDeclare the name of the env in policy.stringtrue
policyDeclare the name of the env-binding policy, if empty, the first env-binding policy will be used.stringfalseempty
placementsDeclare the location to bind.[]placementstrue

placements (share-cloud-resource)

NameDescriptionTypeRequiredDefault
clusterstringfalse
namespacestringfalse

Step-Group

Description

A special step that you can declare ‘subSteps’ in it, ‘subSteps’ is an array containing any step type whose valid parameters do not include the step-group step type itself. The sub steps were executed in parallel.

Examples (step-group)

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

Specification (step-group)

This capability has no arguments.

Suspend

Description

Suspend the current workflow, it can be resumed by ‘vela workflow resume’ command.

Examples (suspend)

The duration parameter is supported in KubeVela v1.4 or higher.

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: first-vela-workflow
  5. namespace: default
  6. spec:
  7. components:
  8. - name: express-server
  9. type: webservice
  10. properties:
  11. image: oamdev/hello-world
  12. port: 8000
  13. workflow:
  14. steps:
  15. - name: slack-message
  16. type: webhook-notification
  17. properties:
  18. slack:
  19. # the Slack webhook address, please refer to: https://api.slack.com/messaging/webhooks
  20. message:
  21. text: Ready to apply the application, ask the administrator to approve and resume the workflow.
  22. - name: manual-approval
  23. type: suspend
  24. # properties:
  25. # duration: "30s"
  26. - name: express-server
  27. type: apply-application

Specification (suspend)

NameDescriptionTypeRequiredDefault
durationSpecify the wait duration time to resume workflow such as “30s”, “1min” or “2m15s”.stringfalse

Webhook

Description

Send a request to the specified Webhook URL. If no request body is specified, the current Application body will be sent by default.

Examples (webhook)

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: first-vela-workflow
  5. namespace: default
  6. spec:
  7. components:
  8. - name: express-server
  9. type: webservice
  10. properties:
  11. image: oamdev/hello-world
  12. port: 8000
  13. workflow:
  14. steps:
  15. - name: express-server
  16. type: apply-application
  17. - name: webhook
  18. type: webhook
  19. properties:
  20. url:
  21. value: <your webhook url>

Specification (webhook)

NameDescriptionTypeRequiredDefault
urlSpecify the webhook url.url-option-0 or url-option-1true
dataSpecify the data you want to send.map[string]:(null|bool|string|bytes|{…}|[…]|number)false

url-option-0 (webhook)

NameDescriptionTypeRequiredDefault
valuestringtrue

url-option-1 (webhook)

NameDescriptionTypeRequiredDefault
secretRefsecretReftrue
secretRef (webhook)
NameDescriptionTypeRequiredDefault
namename is the name of the secret.stringtrue
keykey is the key in the secret.stringtrue