Skip to main content

Playbook

FieldDescriptionScheme
descriptionA short descriptionstring
iconIcon for the playbookIcon
timeoutMaximum duration to let the playbook run before cancellation. Valid time units are "s", "m", "h", "d", "w", "y". Defaults to 30 minutes.string
on.canaryRun a playbook when a health check fails or passesEventTrigger
on.componentRun a playbook when a part becomes heathy/unhealthyEventTrigger
on.configRun a playbook when someone creates/updates/deletes a config item or changes its stateEventTrigger
on.webhookRun a playbook when someone calls a webhookWebhook
runsOnWhich runner (agent) to run the playbook on[]Agent
templatesOnWhere 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
checksWhich health checks this playbook can run on[]ResourceSelector
configsWhich config items this playbook can run on[]ResourceSelector
componentsWhich parts this playbook can run on[]ResourceSelector
envVariables to lookup, available as env map in templating/filters[]EnvVar
parametersVariables that users need to enter. Do not use parameters for sensitive values.[]Parameter
actionsIndividual actions or steps to perform[]Action
approvalOptional approvals required before a playbook runsApproval

Run

FieldDescriptionScheme
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

FieldDescriptionSchemeRequired
nameStep Namestringtrue
runsOnWhich runner (agent) to run the action on[]Agent
templatesOnWhere templating (and secret management) of actions occurshost or agent
delayA delay before running the action e.g. 8hDuration or CEL with Playbook Context
filterConditionally run an actionCEL with Playbook Context
timeoutTimeout on this action.Duration
azureDevopsPipelineTrigger a pipeline runAzureDevops
execRun a script e.g. to use kubectl or aws CLIsExec
githubTrigger Github ActionGithub Action
gitopsUpdate a git repository (directly or via pull request)Gitops
httpCall an HTTP EndpointHttp
sqlExecute a SQL querySql
podRun a kubernetes pod.Pod
notificationSpecify 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.yaml
apiVersion: 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}}
FieldDescriptionSchemeRequired
typeHow many approvals required. Defaults to allany or allfalse
approvers.[]peopleLogin or id of a personPeoplefalse
approvers.[]teamsName or id of a teamTeamfalse