Playbook
Field | Description | Scheme |
---|---|---|
description | A short description | string |
icon | Icon for the playbook | Icon |
timeout | Maximum duration to let the playbook run before cancellation. Valid time units are "s", "m", "h", "d", "w", "y". Defaults to 30 minutes. | string |
on.canary | Run a playbook when a health check fails or passes | EventTrigger |
on.component | Run a playbook when a part becomes heathy/unhealthy | EventTrigger |
on.config | Run a playbook when someone creates/updates/deletes a config item or changes its state | EventTrigger |
on.webhook | Run a playbook when someone calls a webhook | Webhook |
runsOn | Which runner (agent) to run the playbook on | []Agent |
templatesOn | Where the templating of actions occurs For host the templating occurs on the mission control instance before sending 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 this playbook can run on | []ResourceSelector |
configs | Which config items this playbook can run on | []ResourceSelector |
components | Which parts this playbook can run on | []ResourceSelector |
env | Variables to lookup, available as env map in templating/filters | []EnvVar |
parameters | Variables that users need to enter. Do not use parameters for sensitive values. | []Parameter |
actions | Individual actions or steps to perform | []Action |
approval | Optional approvals required before a playbook runs | Approval |
Run
Field | Description | Scheme |
---|---|---|
agent_id | ID of the agent that executed the playbook run | string |
check_id | ID of the check associated with the playbook run | string |
component_id | ID of the component associated with the playbook run | string |
config_id | ID of the config associated with the playbook run | string |
created_by | ID of the user who created the playbook run | string |
id | ID of the playbook run | string |
playbook_id | ID of the playbook | string |
status | Status of the playbook run | string |
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 occurs | 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 CLIs | 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 |