This is not an actual commander, it just listens to Slack slash commands.
The commander accepts one slash command - /knightly
.
With this command you can perform the following actions:
/knightly start namespace <NAME>
It applies knightly label and annotation on the namespace:
metadata:
labels:
knightly.example.com/enabled: true
annotations:
knightly.example.com/keepmeup: "0"
Then it removes KEDA's paused-replicas
annotation (that is being set when stopping a namespace).
And finally scales all deployments in the namespace to 1.
/knightly stop namespace <NAME>
It applies knightly label and annotation on the namespace:
metadata:
labels:
knightly.example.com/enabled: true
annotations:
knightly.example.com/keepmeup: "0"
Then it applies KEDA's paused-replicas
annotation:
metadata:
annotations:
autoscaling.keda.sh/paused-replicas: "0"
And finally scales all deployments in the namespace to 0.
/knightly keep namespace <NAME> <NUM OF DAYS>
Marks a desired namespace to stay up for X days (so the zero-scaler won't stop it) by setting keepmeup
annotation with the desired number of days and changing the label knightly.example.com/enabled
to false
:
metadata:
labels:
knightly.example.com/enabled: false
annotations:
knightly.example.com/keepmeup: "0"
To start the commander slack bot, you'll need to create new slack application and deploy it to your workspace.
Once done, create a slash command and keep the following keys: SLACK_APP_TOKEN
, SLACK_BOT_TOKEN
, SLACK_SIGNING_SECRET
.