Playbooks
Field | Description | Scheme |
---|---|---|
description | A short description | string |
icon | Icon for the playbook | Icon |
on.canary | Run a playbook when a health check fail or passed | EventTrigger |
on.component | Run a playbook when a component becomes heathy/unhealthy | EventTrigger |
on.config | Run a playbook when a config item is created/updated/deleted or changes state | EventTrigger |
on.webhook | Run a playbook when a webhook is called | Webhook |
runsOn | Which runner (agent) to run the playbook on | []Agent |
templatesOn | Where the templating of actions should occur For host the templating occurs on the mission control instance before being passed to the agent For agent the templating occurs on the agent/runner where there might be secrets not accessible by the primary instance. | host or agent |
checks | Which health checks can this playbook run on | []ResourceSelector |
configs | Which config items can this playbook run on | []ResourceSelector |
components | Which components can this playbook run on | []ResourceSelector |
env | Variables to lookup, available as env map in templating/filters | []EnvVar |
parameters | Variables to be supplied by the user, Do not use parameters for sensitive values. | []Parameter |
actions | Individual actions or steps to perform | []Action |
approval | Optional approvals required before a playbooks runs | Approval |
Actions
Field | Description | Scheme | Required |
---|---|---|---|
name | Step Name | string | true |
runsOn | Which runner (agent) to run the action on | []Agent | |
templatesOn | Where templating (and secret management) of actions should occur | host or agent | |
delay | A delay before running the action e.g. 8h | Duration or CEL with Playbook Context | |
filter | Conditionally run an action | CEL with Playbook Context | |
timeout | Timeout on this action. | Duration | |
azureDevopsPipeline | Trigger a pipeline run | AzureDevops | |
exec | Run a script e.g. to use kubectl or aws CLI's | Exec | |
github | Trigger Github Action | Github Action | |
gitops | Update a git repository (directly or via pull request) | Gitops | |
http | Call an HTTP Endpoint | Http | |
sql | Execute a SQL query | Sql | |
pod | Run a kubernetes pod. | Pod | |
notification | Specify notification of action. | Notification |
Only 1 action should be specified per step
Approvals
Approvals allow requiring one or more people to approve before a playbook runs.
scale-deployment.yamlapiVersion: mission-control.flanksource.com/v1
kind: Playbook
metadata:
name: delete-pv
spec:
description: Delete Persistent Volume
configs:
- types:
- Kubernetes::PersistentVolume
approval:
type: any
approvers:
teams:
- DevOps
actions:
- name: kubectl delete pv
exec:
script: kubectl delete persistentvolume {{.config.name}}
Field | Description | Scheme | Required |
---|---|---|---|
type | How many approvals required. Defaults to all | any or all | false |
approvers.[]people | Login or id of a person | People | false |
approvers.[]teams | Name or id of a team | Team | false |