Skip to main content

Playbooks

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

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