Skip to main content
Version: v1.6

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)

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: first-vela-workflow
namespace: default
spec:
components:
- name: express-server
type: webservice
properties:
image: oamdev/hello-world
port: 8000
traits:
- type: ingress
properties:
domain: testsvc.example.com
http:
/: 8000
workflow:
steps:
- name: express-server
type: apply-component
properties:
component: express-server
# 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)

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: server-with-pvc
namespace: default
spec:
components:
- name: express-server
type: webservice
properties:
image: oamdev/hello-world
port: 8000
volumes:
- name: "my-pvc"
type: "pvc"
mountPath: "/test"
claimName: "myclaim"

workflow:
steps:
- name: apply-pvc
type: apply-object
properties:
# Kubernetes native resources fields
value:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: myclaim
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
storageClassName: standard
# the cluster you want to apply the resource to, default is the current cluster
cluster: <your cluster name>
- name: apply-server
type: apply-component
properties:
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)

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: app-collect-service-endpoint-and-export
spec:
components:
- type: webservice
name: busybox
properties:
image: busybox
imagePullPolicy: IfNotPresent
cmd:
- sleep
- '1000000'
traits:
- type: expose
properties:
port: [8080]
type: ClusterIP
policies:
- type: topology
name: local
properties:
clusters: ["local"]
- type: topology
name: all
properties:
clusters: ["local", "cluster-worker"]
workflow:
steps:
- type: deploy
name: deploy
properties:
policies: ["local"]
- type: collect-service-endpoints
name: collect-service-endpoints
outputs:
- name: host
valueFrom: value.endpoint.host
- type: export-data
name: export-data
properties:
topology: all
inputs:
- from: host
parameterKey: data.host

Specification (collect-service-endpoints)

This capability has no arguments.

Create-Config

Description

Create or update a config.

Examples (create-config)

kind: Application
apiVersion: core.oam.dev/v1beta1
metadata:
name: test-config
namespace: "config-e2e-test"
spec:
components: []
workflow:
steps:
- name: write-config
type: create-config
properties:
name: test
config:
key1: value1
key2: 2
key3: true
key4:
key5: value5
- name: read-config
type: read-config
properties:
name: test
outputs:
- fromKey: config
name: read-config
- name: delete-config
type: delete-config
properties:
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)

kind: Application
apiVersion: core.oam.dev/v1beta1
metadata:
name: test-config
namespace: "config-e2e-test"
spec:
components: []
workflow:
steps:
- name: write-config
type: create-config
properties:
name: test
config:
key1: value1
key2: 2
key3: true
key4:
key5: value5
- name: delete-config
type: delete-config
properties:
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)

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: first-vela-workflow
namespace: default
spec:
components:
- name: express-server
type: webservice
properties:
image: oamdev/hello-world
port: 8000
traits:
- type: ingress
properties:
domain: testsvc.example.com
http:
/: 8000
workflow:
steps:
- name: express-server
type: depends-on-app
properties:
name: another-app
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.

apiVersion: v1
kind: ConfigMap
metadata:
name: myapp
namespace: vela-system
data:
application:
<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)

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: deploy-workflowstep
namespace: examples
spec:
components:
- name: nginx-deploy-workflowstep
type: webservice
properties:
image: nginx
policies:
- name: topology-hangzhou-clusters
type: topology
properties:
clusterLabelSelector:
region: hangzhou
- name: topology-local
type: topology
properties:
clusters: ["local"]
namespace: examples-alternative
workflow:
steps:
- type: deploy
name: deploy-local
properties:
policies: ["topology-local"]
- type: deploy
name: deploy-hangzhou
properties:
# require manual approval before running this step
auto: false
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)

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: rds-app
namespace: project-1
spec:
components:
- name: db
type: alibaba-rds
properties:
instance_name: db
account_name: kubevela
password: my-password
writeConnectionSecretToRef:
name: project-1-rds-conn-credential
policies:
- name: env-policy
type: env-binding
properties:
envs:
# 部署 RDS 给杭州集群
- name: hangzhou
placement:
clusterSelector:
name: cluster-hangzhou
patch:
components:
- name: db
type: alibaba-rds
properties:
# region: hangzhou
instance_name: hangzhou_db
# 部署 RDS 给香港集群
- name: hongkong
placement:
clusterSelector:
name: cluster-hongkong
namespaceSelector:
name: hk-project-1
patch:
components:
- name: db
type: alibaba-rds
properties:
# region: hongkong
instance_name: hongkong_db
writeConnectionSecretToRef:
name: hk-project-rds-credential

workflow:
steps:
# 部署 RDS 给杭州区用
- name: deploy-hangzhou-rds
type: deploy-cloud-resource
properties:
env: hangzhou
# 将给杭州区用的 RDS 共享给北京区
- name: share-hangzhou-rds-to-beijing
type: share-cloud-resource
properties:
env: hangzhou
placements:
- cluster: cluster-beijing
# 部署 RDS 给香港区用
- name: deploy-hongkong-rds
type: deploy-cloud-resource
properties:
env: hongkong
# 将给香港区用的 RDS 共享给香港区其他项目用
- name: share-hongkong-rds-to-other-namespace
type: share-cloud-resource
properties:
env: hongkong
placements:
- cluster: cluster-hongkong
namespace: hk-project-2
- cluster: cluster-hongkong
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)

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: app-collect-service-endpoint-and-export
spec:
components:
- type: webservice
name: busybox
properties:
image: busybox
imagePullPolicy: IfNotPresent
cmd:
- sleep
- '1000000'
traits:
- type: expose
properties:
port: [8080]
type: ClusterIP
policies:
- type: topology
name: local
properties:
clusters: ["local"]
- type: topology
name: all
properties:
clusters: ["local", "cluster-worker"]
workflow:
steps:
- type: deploy
name: deploy
properties:
policies: ["local"]
- type: collect-service-endpoints
name: collect-service-endpoints
outputs:
- name: host
valueFrom: value.endpoint.host
- type: export-data
name: export-data
properties:
topology: all
inputs:
- from: host
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)

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: app-collect-service-endpoint-and-export
spec:
components:
- type: webservice
name: busybox
properties:
image: busybox
imagePullPolicy: IfNotPresent
cmd:
- sleep
- '1000000'
traits:
- type: expose
properties:
port: [8080]
type: LoadBalancer
policies:
- type: topology
name: local
properties:
clusters: ["local"]
- type: topology
name: worker
properties:
clusters: ["cluster-worker"]
workflow:
steps:
- type: deploy
name: deploy
properties:
policies: ["local"]
- type: collect-service-endpoints
name: collect-service-endpoints
outputs:
- name: host
valueFrom: value.endpoint.host
- name: port
valueFrom: value.endpoint.port
- type: export-service
name: export-service
properties:
name: busybox
topology: worker
inputs:
- from: host
parameterKey: ip
- from: port
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)

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: export2config
namespace: default
spec:
components:
- name: export2config-demo-server
type: webservice
properties:
image: oamdev/hello-world
port: 8000
workflow:
steps:
- name: apply-server
type: apply-component
outputs:
- name: status
valueFrom: output.status.conditions[0].message
properties:
component: export2config-demo-server
- name: export-config
type: export2config
inputs:
- from: status
parameterKey: data.serverstatus
properties:
configName: my-configmap
data:
testkey: |
testvalue
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)

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: export-secret
namespace: default
spec:
components:
- name: express-server-sec
type: webservice
properties:
image: oamdev/hello-world
port: 8000
workflow:
steps:
- name: apply-server
type: apply-component
outputs:
- name: status
valueFrom: output.status.conditions[0].message
properties:
component: express-server-sec
- name: export-secret
type: export2secret
inputs:
- from: status
parameterKey: data.serverstatus
properties:
secretName: my-secret
data:
testkey: |
testvalue
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)

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: jdbc
spec:
components:
- name: db
type: alibaba-rds
properties:
instance_name: favorite-links
database_name: db1
account_name: oamtest
password: U34rfwefwefffaked
security_ips: [ "0.0.0.0/0" ]
privilege: ReadWrite
writeConnectionSecretToRef:
name: db-conn
- name: express-server
type: webservice
properties:
image: crccheck/hello-world
port: 8000

workflow:
steps:
- name: jdbc
type: generate-jdbc-connection
outputs:
- name: jdbc
valueFrom: jdbc
properties:
name: db-conn
namespace: default
- name: apply
type: apply-component
inputs:
- from: jdbc
parameterKey: env
properties:
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)

apiVersion: core.oam.dev/v1alpha1
kind: WorkflowRun
metadata:
name: observability
namespace: vela-system
spec:
context:
readConfig: true
mode:
workflowSpec:
steps:
- name: Enable Prism
type: addon-operation
properties:
addonName: vela-prism

- name: Enable o11y
type: addon-operation
properties:
addonName: o11y-definitions
operation: enable
args:
- --override-definitions

- name: Prepare Prometheus
type: step-group
subSteps:
- name: get-exist-prometheus
type: list-config
properties:
template: prometheus-server
outputs:
- name: prometheus
valueFrom: "output.configs"

- name: prometheus-server
inputs:
- from: prometheus
# TODO: Make it is not required
parameterKey: configs
if: "!context.readConfig || len(inputs.prometheus) == 0"
type: addon-operation
properties:
addonName: prometheus-server
operation: enable
args:
- memory=4096Mi
- 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)

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: first-vela-workflow
namespace: default
spec:
components:
- name: express-server
type: webservice
properties:
image: oamdev/hello-world
port: 8000
traits:
- type: ingress
properties:
domain: testsvc.example.com
http:
/: 8000
workflow:
steps:
- name: dingtalk-message
type: notification
properties:
dingding:
# the DingTalk webhook address, please refer to: https://developers.dingtalk.com/document/robots/custom-robot-access
url:
value: <url>
message:
msgtype: text
text:
content: Workflow starting...
- name: application
type: apply-application
- name: slack-message
type: notification
properties:
slack:
# the Slack webhook address, please refer to: https://api.slack.com/messaging/webhooks
url:
secretRef:
name: <secret-key>
key: <secret-value>
message:
text: Workflow ended.
lark:
url:
value: <lark-url>
message:
msg_type: "text"
content: "{\"text\":\" Hello KubeVela\"}"
email:
from:
address: <sender-email-address>
alias: <sender-alias>
password:
# secretRef:
# name: <secret-name>
# key: <secret-key>
value: <sender-password>
host: <email host like smtp.gmail.com>
port: <email port, optional, default to 587>
to:
- kubevela1@gmail.com
- kubevela2@gmail.com
content:
subject: test-subject
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

Description

print message in workflow step status.

Examples (print-message-in-status)

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: print-message-in-status
namespace: default
spec:
components:
- name: express-server
type: webservice
properties:
image: oamdev/hello-world
port: 8000
workflow:
steps:
- name: express-server
type: apply-component
properties:
component: express-server
- name: message
type: print-message-in-status
properties:
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)

kind: Application
apiVersion: core.oam.dev/v1beta1
metadata:
name: test-config
namespace: "config-e2e-test"
spec:
components: []
workflow:
steps:
- name: read-config
type: read-config
properties:
name: test
outputs:
- fromKey: config
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)

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: read-object
namespace: default
spec:
components:
- name: express-server
type: webservice
properties:
image: oamdev/hello-world
port: 8000
workflow:
steps:
- name: read-object
type: read-object
outputs:
- name: cpu
valueFrom: output.value.data["cpu"]
- name: memory
valueFrom: output.value.data["memory"]
properties:
apiVersion: v1
kind: ConfigMap
name: my-cm-name
cluster: <your cluster name
- name: apply
type: apply-component
inputs:
- from: cpu
parameterKey: cpu
- from: memory
parameterKey: memory
properties:
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)

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: rds-app
namespace: project-1
spec:
components:
- name: db
type: alibaba-rds
properties:
instance_name: db
account_name: kubevela
password: my-password
writeConnectionSecretToRef:
name: project-1-rds-conn-credential
policies:
- name: env-policy
type: env-binding
properties:
envs:
# 部署 RDS 给杭州集群
- name: hangzhou
placement:
clusterSelector:
name: cluster-hangzhou
patch:
components:
- name: db
type: alibaba-rds
properties:
# region: hangzhou
instance_name: hangzhou_db
# 部署 RDS 给香港集群
- name: hongkong
placement:
clusterSelector:
name: cluster-hongkong
namespaceSelector:
name: hk-project-1
patch:
components:
- name: db
type: alibaba-rds
properties:
# region: hongkong
instance_name: hongkong_db
writeConnectionSecretToRef:
name: hk-project-rds-credential

workflow:
steps:
# 部署 RDS 给杭州区用
- name: deploy-hangzhou-rds
type: deploy-cloud-resource
properties:
env: hangzhou
# 将给杭州区用的 RDS 共享给北京区
- name: share-hangzhou-rds-to-beijing
type: share-cloud-resource
properties:
env: hangzhou
placements:
- cluster: cluster-beijing
# 部署 RDS 给香港区用
- name: deploy-hongkong-rds
type: deploy-cloud-resource
properties:
env: hongkong
# 将给香港区用的 RDS 共享给香港区其他项目用
- name: share-hongkong-rds-to-other-namespace
type: share-cloud-resource
properties:
env: hongkong
placements:
- cluster: cluster-hongkong
namespace: hk-project-2
- cluster: cluster-hongkong
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)

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: example
namespace: default
spec:
components:
- name: express-server
type: webservice
properties:
image: crccheck/hello-world
port: 8000
- name: express-server2
type: webservice
properties:
image: crccheck/hello-world
port: 8000

workflow:
steps:
- name: step
type: step-group
subSteps:
- name: apply-sub-step1
type: apply-component
properties:
component: express-server
- name: apply-sub-step2
type: apply-component
properties:
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.

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: first-vela-workflow
namespace: default
spec:
components:
- name: express-server
type: webservice
properties:
image: oamdev/hello-world
port: 8000
workflow:
steps:
- name: slack-message
type: notification
properties:
slack:
url:
value: <your-slack-url>
# the Slack webhook address, please refer to: https://api.slack.com/messaging/webhooks
message:
text: Ready to apply the application, ask the administrator to approve and resume the workflow.
- name: manual-approval
type: suspend
# properties:
# duration: "30s"
- name: express-server
type: apply-component
properties:
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)

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: first-vela-workflow
namespace: default
spec:
components:
- name: express-server
type: webservice
properties:
image: oamdev/hello-world
port: 8000
workflow:
steps:
- name: express-server
type: apply-application
- name: webhook
type: webhook
properties:
url:
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