Skip to main content

Playbook

FieldDescriptionScheme
descriptionA short descriptionstring
iconIcon for the playbookIcon
on.canaryRun a playbook when a health check fail or passedEventTrigger
on.componentRun a playbook when a component becomes heathy/unhealthyEventTrigger
on.configRun a playbook when a config item is created/updated/deleted or changes stateEventTrigger
on.webhookRun a playbook when a webhook is calledWebhook
runsOnWhich runner (agent) to run the playbook on[]Agent
templatesOnWhere 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
checksWhich health checks can this playbook run on[]ResourceSelector
configsWhich config items can this playbook run on[]ResourceSelector
componentsWhich components can this playbook run on[]ResourceSelector
envVariables to lookup, available as env map in templating/filters[]EnvVar
parametersVariables to be supplied by the user, Do not use parameters for sensitive values.[]Parameter
actionsIndividual actions or steps to perform[]Action
approvalOptional approvals required before a playbooks 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 should occurhost 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 CLI'sExec
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