Skip to main content

Quick Start

In this walkthrough, we'll create and run a playbook that scales a Kubernetes deployment. The only prerequisites are

Prerequisites
  • Mission Control is installed and configured
  • The mission-control-sa service account has relevant permissions
  • kubectl is installed and connected
1Create a playbook spec
restart-deployment.yaml
apiVersion: mission-control.flanksource.com/v1
kind: Playbook
metadata:
name: restart-deployment
spec:
description: Restart deployment
configs:
- types:
- Kubernetes::Deployment
actions:
- name: kubectl rollout restart deployment
exec:
script: kubectl rollout restart deployment {{.config.name}} -n {{.config.tags.namespace}}

See Playbook for the full specification.

2Apply the playbook
kubectl apply -f restart-deployment.yaml
warning

This is for development purposes, for production use a GitOps tool like Flux or Argo to apply the spec.

Add playbook from UI

a. Navigate to the Playbooks page
b. Click on the icon to add a new playbook
c. Add the spec from the YAML file above

3Run the playbook

a. Navigate to a Deployment in the Catalog
b. Select Restart Deployment from the Playbooks menu
c. Click Run

See Event Triggers to run the playbook on event (e.g. pod crashlooping)
See Webhooks to run the playbook from a webhook (e.g. on Git push)

4See the Results