Workflows enable us to define the orchestration of the application deployment. To do that, an application may be associated with a Workflow in which we make use of the available WorkflowStepDefinitions to define the individual steps.
To illustrate how workflows can be used, lets take the WordPress example and define a workflow that will perform the following steps:
- Deploy a test service that simulates a discovery subsystem. This will be use later on to demonstrate how the workflow can communicate with other subsystems.
- Deploy mysql
- Deploy wordpress
- Send a registration message to an HTTP endpoint
- Add information to the application status
To execute the example, use:
vela up -f scenarios/complex_app/wordpress_with_workflow.yml
Checking the status will show the state of the workflow and its progress
$ vela status my-wordpress-wf -n kubecon
About:
Name: my-wordpress-wf
Namespace: kubecon
Created at: 2023-04-11 17:20:12 +0200 CEST
Status: running
Workflow:
mode: StepByStep-DAG
finished: true
Suspend: false
Terminated: false
Steps
- id: ebahqxk2hy
name: deploy-fake-discover-svc
type: apply-component
phase: succeeded
- id: eu29okbop9
name: deploy-mysql
type: apply-component
phase: succeeded
- id: k3d4pmzy5o
name: deploy-wordpress
type: apply-component
phase: succeeded
- id: prdd9jyqsi
name: notify
type: webhook
phase: succeeded
- id: nvshorkp1s
name: deployed
type: print-message-in-status
phase: succeeded
message: App has been deployed, connect through http://localhost:8090/ or http://localhost depending on the cluster deployment
...