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-12-06T16:17:10+08:00.

Apply-Component

Description

Apply a specific component and its corresponding traits in application.

Examples (apply-component)

  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: apply-component
  23. properties:
  24. component: express-server
  25. # cluster: <your cluster name>

Specification (apply-component)

NameDescriptionTypeRequiredDefault
componentSpecify the component name to apply.stringtrue
clusterSpecify the cluster.stringfalseempty

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]_true
clusterThe cluster you want to apply the resource to, default is the current control plane cluster.stringfalseempty

Collect-Service-Endpoints

Description

Collect service endpoints for the application.

Examples (collect-service-endpoints)

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: app-collect-service-endpoint-and-export
  5. spec:
  6. components:
  7. - type: webservice
  8. name: busybox
  9. properties:
  10. image: busybox
  11. imagePullPolicy: IfNotPresent
  12. cmd:
  13. - sleep
  14. - '1000000'
  15. traits:
  16. - type: expose
  17. properties:
  18. port: [8080]
  19. type: ClusterIP
  20. policies:
  21. - type: topology
  22. name: local
  23. properties:
  24. clusters: ["local"]
  25. - type: topology
  26. name: all
  27. properties:
  28. clusters: ["local", "cluster-worker"]
  29. workflow:
  30. steps:
  31. - type: deploy
  32. name: deploy
  33. properties:
  34. policies: ["local"]
  35. - type: collect-service-endpoints
  36. name: collect-service-endpoints
  37. outputs:
  38. - name: host
  39. valueFrom: value.endpoint.host
  40. - type: export-data
  41. name: export-data
  42. properties:
  43. topology: all
  44. inputs:
  45. - from: host
  46. parameterKey: data.host

Specification (collect-service-endpoints)

This capability has no arguments.

Create-Config

Description

Create or update a config.

Examples (create-config)

  1. kind: Application
  2. apiVersion: core.oam.dev/v1beta1
  3. metadata:
  4. name: test-config
  5. namespace: "config-e2e-test"
  6. spec:
  7. components: []
  8. workflow:
  9. steps:
  10. - name: write-config
  11. type: create-config
  12. properties:
  13. name: test
  14. config:
  15. key1: value1
  16. key2: 2
  17. key3: true
  18. key4:
  19. key5: value5
  20. - name: read-config
  21. type: read-config
  22. properties:
  23. name: test
  24. outputs:
  25. - fromKey: config
  26. name: read-config
  27. - name: delete-config
  28. type: delete-config
  29. properties:
  30. name: test

Specification (create-config)

NameDescriptionTypeRequiredDefault
nameSpecify the name of the config.stringtrue
namespaceSpecify the namespace of the config.stringfalse
templateSpecify the template of the config.stringfalse
configSpecify the content of the config.map[string]_true

Delete-Config

Description

Delete a config.

Examples (delete-config)

  1. kind: Application
  2. apiVersion: core.oam.dev/v1beta1
  3. metadata:
  4. name: test-config
  5. namespace: "config-e2e-test"
  6. spec:
  7. components: []
  8. workflow:
  9. steps:
  10. - name: write-config
  11. type: create-config
  12. properties:
  13. name: test
  14. config:
  15. key1: value1
  16. key2: 2
  17. key3: true
  18. key4:
  19. key5: value5
  20. - name: delete-config
  21. type: delete-config
  22. properties:
  23. name: test

Specification (delete-config)

NameDescriptionTypeRequiredDefault
nameSpecify the name of the config.stringtrue
namespaceSpecify the namespace of the config.stringfalse

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
autoIf set to false, the workflow will suspend automatically before this step, default to be true.boolfalsetrue
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

Deploy-Cloud-Resource

Description

Deploy cloud resource and deliver secret to multi clusters.

Examples (deploy-cloud-resource)

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: rds-app
  5. namespace: project-1
  6. spec:
  7. components:
  8. - name: db
  9. type: alibaba-rds
  10. properties:
  11. instance_name: db
  12. account_name: kubevela
  13. password: my-password
  14. writeConnectionSecretToRef:
  15. name: project-1-rds-conn-credential
  16. policies:
  17. - name: env-policy
  18. type: env-binding
  19. properties:
  20. envs:
  21. # 部署 RDS 给杭州集群
  22. - name: hangzhou
  23. placement:
  24. clusterSelector:
  25. name: cluster-hangzhou
  26. patch:
  27. components:
  28. - name: db
  29. type: alibaba-rds
  30. properties:
  31. # region: hangzhou
  32. instance_name: hangzhou_db
  33. # 部署 RDS 给香港集群
  34. - name: hongkong
  35. placement:
  36. clusterSelector:
  37. name: cluster-hongkong
  38. namespaceSelector:
  39. name: hk-project-1
  40. patch:
  41. components:
  42. - name: db
  43. type: alibaba-rds
  44. properties:
  45. # region: hongkong
  46. instance_name: hongkong_db
  47. writeConnectionSecretToRef:
  48. name: hk-project-rds-credential
  49. workflow:
  50. steps:
  51. # 部署 RDS 给杭州区用
  52. - name: deploy-hangzhou-rds
  53. type: deploy-cloud-resource
  54. properties:
  55. env: hangzhou
  56. # 将给杭州区用的 RDS 共享给北京区
  57. - name: share-hangzhou-rds-to-beijing
  58. type: share-cloud-resource
  59. properties:
  60. env: hangzhou
  61. placements:
  62. - cluster: cluster-beijing
  63. # 部署 RDS 给香港区用
  64. - name: deploy-hongkong-rds
  65. type: deploy-cloud-resource
  66. properties:
  67. env: hongkong
  68. # 将给香港区用的 RDS 共享给香港区其他项目用
  69. - name: share-hongkong-rds-to-other-namespace
  70. type: share-cloud-resource
  71. properties:
  72. env: hongkong
  73. placements:
  74. - cluster: cluster-hongkong
  75. namespace: hk-project-2
  76. - cluster: cluster-hongkong
  77. namespace: hk-project-3

Specification (deploy-cloud-resource)

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

Export-Data

Description

Export data to clusters specified by topology.

Examples (export-data)

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: app-collect-service-endpoint-and-export
  5. spec:
  6. components:
  7. - type: webservice
  8. name: busybox
  9. properties:
  10. image: busybox
  11. imagePullPolicy: IfNotPresent
  12. cmd:
  13. - sleep
  14. - '1000000'
  15. traits:
  16. - type: expose
  17. properties:
  18. port: [8080]
  19. type: ClusterIP
  20. policies:
  21. - type: topology
  22. name: local
  23. properties:
  24. clusters: ["local"]
  25. - type: topology
  26. name: all
  27. properties:
  28. clusters: ["local", "cluster-worker"]
  29. workflow:
  30. steps:
  31. - type: deploy
  32. name: deploy
  33. properties:
  34. policies: ["local"]
  35. - type: collect-service-endpoints
  36. name: collect-service-endpoints
  37. outputs:
  38. - name: host
  39. valueFrom: value.endpoint.host
  40. - type: export-data
  41. name: export-data
  42. properties:
  43. topology: all
  44. inputs:
  45. - from: host
  46. parameterKey: data.host

Specification (export-data)

NameDescriptionTypeRequiredDefault
nameSpecify the name of the export destination.stringfalse
namespaceSpecify the namespace of the export destination.stringfalse
kindSpecify the kind of the export destination.“ConfigMap” or “Secret”falseConfigMap
dataSpecify the data to export.structtrue
topologySpecify the topology to export.stringfalse

Export-Service

Description

Export service to clusters specified by topology.

Examples (export-service)

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: app-collect-service-endpoint-and-export
  5. spec:
  6. components:
  7. - type: webservice
  8. name: busybox
  9. properties:
  10. image: busybox
  11. imagePullPolicy: IfNotPresent
  12. cmd:
  13. - sleep
  14. - '1000000'
  15. traits:
  16. - type: expose
  17. properties:
  18. port: [8080]
  19. type: LoadBalancer
  20. policies:
  21. - type: topology
  22. name: local
  23. properties:
  24. clusters: ["local"]
  25. - type: topology
  26. name: worker
  27. properties:
  28. clusters: ["cluster-worker"]
  29. workflow:
  30. steps:
  31. - type: deploy
  32. name: deploy
  33. properties:
  34. policies: ["local"]
  35. - type: collect-service-endpoints
  36. name: collect-service-endpoints
  37. outputs:
  38. - name: host
  39. valueFrom: value.endpoint.host
  40. - name: port
  41. valueFrom: value.endpoint.port
  42. - type: export-service
  43. name: export-service
  44. properties:
  45. name: busybox
  46. topology: worker
  47. inputs:
  48. - from: host
  49. parameterKey: ip
  50. - from: port
  51. parameterKey: port

Specification (export-service)

NameDescriptionTypeRequiredDefault
nameSpecify the name of the export destination.stringfalse
namespaceSpecify the namespace of the export destination.stringfalse
ipSpecify the ip to be export.stringtrue
portSpecify the port to be used in service.inttrue
targetPortSpecify the port to be export.inttrue
topologySpecify the topology to export.stringfalse

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: export2config
  5. namespace: default
  6. spec:
  7. components:
  8. - name: export2config-demo-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: export2config-demo-server
  22. - name: export-config
  23. type: export2config
  24. inputs:
  25. - from: status
  26. parameterKey: data.serverstatus
  27. properties:
  28. configName: my-configmap
  29. data:
  30. testkey: |
  31. testvalue
  32. value-line-2

Specification (export2config)

NameDescriptionTypeRequiredDefault
configNameSpecify the name of the config map.stringtrue
namespaceSpecify the namespace of the config map.stringfalse
dataSpecify the data of config map.structtrue
clusterSpecify the cluster of the config map.stringfalseempty

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-sec
  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-sec
  22. - name: export-secret
  23. type: export2secret
  24. inputs:
  25. - from: status
  26. parameterKey: data.serverstatus
  27. properties:
  28. secretName: my-secret
  29. data:
  30. testkey: |
  31. testvalue
  32. value-line-2

Specification (export2secret)

NameDescriptionTypeRequiredDefault
secretNameSpecify the name of the secret.stringtrue
namespaceSpecify the namespace of the secret.stringfalse
typeSpecify the type of the secret.stringfalse
dataSpecify the data of secret.structtrue
clusterSpecify the cluster of the secret.stringfalseempty

Generate-Jdbc-Connection

Description

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

Examples (generate-jdbc-connection)

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: jdbc
  5. spec:
  6. components:
  7. - name: db
  8. type: alibaba-rds
  9. properties:
  10. instance_name: favorite-links
  11. database_name: db1
  12. account_name: oamtest
  13. password: U34rfwefwefffaked
  14. security_ips: [ "0.0.0.0/0" ]
  15. privilege: ReadWrite
  16. writeConnectionSecretToRef:
  17. name: db-conn
  18. - name: express-server
  19. type: webservice
  20. properties:
  21. image: crccheck/hello-world
  22. port: 8000
  23. workflow:
  24. steps:
  25. - name: jdbc
  26. type: generate-jdbc-connection
  27. outputs:
  28. - name: jdbc
  29. valueFrom: jdbc
  30. properties:
  31. name: db-conn
  32. namespace: default
  33. - name: apply
  34. type: apply-component
  35. inputs:
  36. - from: jdbc
  37. parameterKey: env
  38. properties:
  39. component: express-server

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

List-Config

Description

List the configs.

Examples (list-config)

  1. apiVersion: core.oam.dev/v1alpha1
  2. kind: WorkflowRun
  3. metadata:
  4. name: observability
  5. namespace: vela-system
  6. spec:
  7. context:
  8. readConfig: true
  9. mode:
  10. workflowSpec:
  11. steps:
  12. - name: Enable Prism
  13. type: addon-operation
  14. properties:
  15. addonName: vela-prism
  16. - name: Enable o11y
  17. type: addon-operation
  18. properties:
  19. addonName: o11y-definitions
  20. operation: enable
  21. args:
  22. - --override-definitions
  23. - name: Prepare Prometheus
  24. type: step-group
  25. subSteps:
  26. - name: get-exist-prometheus
  27. type: list-config
  28. properties:
  29. template: prometheus-server
  30. outputs:
  31. - name: prometheus
  32. valueFrom: "output.configs"
  33. - name: prometheus-server
  34. inputs:
  35. - from: prometheus
  36. # TODO: Make it is not required
  37. parameterKey: configs
  38. if: "!context.readConfig || len(inputs.prometheus) == 0"
  39. type: addon-operation
  40. properties:
  41. addonName: prometheus-server
  42. operation: enable
  43. args:
  44. - memory=4096Mi
  45. - serviceType=LoadBalancer

Specification (list-config)

NameDescriptionTypeRequiredDefault
templateSpecify the template of the config.stringtrue
namespaceSpecify the namespace of the config.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
dingdingPlease fulfill its url and message if you want to send DingTalk messages.dingdingfalse
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

lark (notification)

NameDescriptionTypeRequiredDefault
urlSpecify the the lark url, you can either sepcify it in value or use secretRef.type-option-1 or type-option-2true
messageSpecify the message that you want to sent, refer to Lark messaging.messagetrue
type-option-1 (notification)
NameDescriptionTypeRequiredDefault
valuethe url address content in string.stringtrue
type-option-2 (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
msg_typemsg_type can be text, post, image, interactive, share_chat, share_user, audio, media, file, sticker.stringtrue
contentcontent should be json encode string.stringtrue

dingding (notification)

NameDescriptionTypeRequiredDefault
urlSpecify the the dingding url, you can either sepcify it in value or use secretRef.type-option-1 or type-option-2true
messageSpecify the message that you want to sent, refer to dingtalk messaging.messagetrue
type-option-1 (notification)
NameDescriptionTypeRequiredDefault
valuethe url address content in string.stringtrue
type-option-2 (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.nullfalse
msgtypemsgType can be text, link, mardown, actionCard, feedCard.“text” or “link” or “markdown” or “actionCard” or “feedCard”falsetext
linknullfalse
markdownnullfalse
atnullfalse
actionCardnullfalse
feedCardnullfalse

slack (notification)

NameDescriptionTypeRequiredDefault
urlSpecify the the slack url, you can either sepcify it in value or use secretRef.type-option-1 or type-option-2true
messageSpecify the message that you want to sent, refer to slack messaging.messagetrue
type-option-1 (notification)
NameDescriptionTypeRequiredDefault
valuethe url address content in string.stringtrue
type-option-2 (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
blocksnullfalse
attachmentsnullfalse
thread_tsstringfalse
mrkdwnSpecify the message text format in markdown for slack notification.boolfalsetrue

email (notification)

NameDescriptionTypeRequiredDefault
fromSpecify the email info that you want to send from.fromtrue
toSpecify the email address that you want to send to.[]stringtrue
contentSpecify the content of the email.contenttrue
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.type-option-1 or type-option-2true
hostSpecify the host of your email.stringtrue
portSpecify the port of the email host, default to 587.intfalse587
type-option-1 (notification)
NameDescriptionTypeRequiredDefault
valuethe password content in string.stringtrue
type-option-2 (notification)
NameDescriptionTypeRequiredDefault
secretRefsecretReftrue
secretRef (notification)
NameDescriptionTypeRequiredDefault
namename is the name of the secret.stringtrue
keykey is the key in the secret.stringtrue
content (notification)
NameDescriptionTypeRequiredDefault
subjectSpecify the subject of the email.stringtrue
bodySpecify the context body of the email.stringtrue

Print-Message-In-Status

Description

print message in workflow step status.

Examples (print-message-in-status)

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: print-message-in-status
  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-component
  17. properties:
  18. component: express-server
  19. - name: message
  20. type: print-message-in-status
  21. properties:
  22. message: "All addons have been enabled successfully, you can use 'vela addon list' to check them."

Specification (print-message-in-status)

NameDescriptionTypeRequiredDefault
messagestringtrue

Read-Config

Description

Read a config.

Examples (read-config)

  1. kind: Application
  2. apiVersion: core.oam.dev/v1beta1
  3. metadata:
  4. name: test-config
  5. namespace: "config-e2e-test"
  6. spec:
  7. components: []
  8. workflow:
  9. steps:
  10. - name: read-config
  11. type: read-config
  12. properties:
  13. name: test
  14. outputs:
  15. - fromKey: config
  16. name: read-config

Specification (read-config)

NameDescriptionTypeRequiredDefault
nameSpecify the name of the config.stringtrue
namespaceSpecify the namespace of the config.stringfalse

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

Share-Cloud-Resource

Description

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

Examples (share-cloud-resource)

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: rds-app
  5. namespace: project-1
  6. spec:
  7. components:
  8. - name: db
  9. type: alibaba-rds
  10. properties:
  11. instance_name: db
  12. account_name: kubevela
  13. password: my-password
  14. writeConnectionSecretToRef:
  15. name: project-1-rds-conn-credential
  16. policies:
  17. - name: env-policy
  18. type: env-binding
  19. properties:
  20. envs:
  21. # 部署 RDS 给杭州集群
  22. - name: hangzhou
  23. placement:
  24. clusterSelector:
  25. name: cluster-hangzhou
  26. patch:
  27. components:
  28. - name: db
  29. type: alibaba-rds
  30. properties:
  31. # region: hangzhou
  32. instance_name: hangzhou_db
  33. # 部署 RDS 给香港集群
  34. - name: hongkong
  35. placement:
  36. clusterSelector:
  37. name: cluster-hongkong
  38. namespaceSelector:
  39. name: hk-project-1
  40. patch:
  41. components:
  42. - name: db
  43. type: alibaba-rds
  44. properties:
  45. # region: hongkong
  46. instance_name: hongkong_db
  47. writeConnectionSecretToRef:
  48. name: hk-project-rds-credential
  49. workflow:
  50. steps:
  51. # 部署 RDS 给杭州区用
  52. - name: deploy-hangzhou-rds
  53. type: deploy-cloud-resource
  54. properties:
  55. env: hangzhou
  56. # 将给杭州区用的 RDS 共享给北京区
  57. - name: share-hangzhou-rds-to-beijing
  58. type: share-cloud-resource
  59. properties:
  60. env: hangzhou
  61. placements:
  62. - cluster: cluster-beijing
  63. # 部署 RDS 给香港区用
  64. - name: deploy-hongkong-rds
  65. type: deploy-cloud-resource
  66. properties:
  67. env: hongkong
  68. # 将给香港区用的 RDS 共享给香港区其他项目用
  69. - name: share-hongkong-rds-to-other-namespace
  70. type: share-cloud-resource
  71. properties:
  72. env: hongkong
  73. placements:
  74. - cluster: cluster-hongkong
  75. namespace: hk-project-2
  76. - cluster: cluster-hongkong
  77. namespace: hk-project-3

Specification (share-cloud-resource)

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

placements (share-cloud-resource)

NameDescriptionTypeRequiredDefault
namespacestringfalse
clusterstringfalse

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: notification
  17. properties:
  18. slack:
  19. url:
  20. value: <your-slack-url>
  21. # the Slack webhook address, please refer to: https://api.slack.com/messaging/webhooks
  22. message:
  23. text: Ready to apply the application, ask the administrator to approve and resume the workflow.
  24. - name: manual-approval
  25. type: suspend
  26. # properties:
  27. # duration: "30s"
  28. - name: express-server
  29. type: apply-component
  30. properties:
  31. component: express-server

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.type-option-1 or type-option-2true
dataSpecify the data you want to send.map[string]_false

type-option-1 (webhook)

NameDescriptionTypeRequiredDefault
valuestringtrue

type-option-2 (webhook)

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