@BotKube allows you to execute kubectl commands on your Kubernetes cluster. Run /botkubehelp to find more information about the supported commands.
By default, kubectl command execution is disabled. To enable this feature, set settings.kubectl.enabled: true
in resource_config.
As suggested in help message, to execute kubectl commands, send message in following format in the channel where BotKube is already added or as a direct message to BotKube.
@BotKube <kubectl command without `kubectl` prefix> [--cluster-name <cluster_name>]
While deploying BotKube controller, you can specify which kubectl commands you want to allow BotKube to execute through configuration.
To check which commands are allowed for users to execute through BotKube, run @BotKube commands list
BotKube configuration allows you to give execution of kubectl commands
Run @BotKube < kubectl command without kubectl prefix > to get kubectl response from the cluster configured with the channel.
This command needs to be executed from configured channel else use --cluster-name
flag described below.
If you have installed BotKube backend on multiple clusters, you can pass --cluster-name
flag to execute kubectl command on specific cluster.
To get the list of all clusters configured in botkube, you can use the ping command.
For cluster-specific response,
use --cluster-name
flag to specify the cluster’s name on which command needs to be executed.
Use of this flag allows you to get response from any channel or group where BotKube is added.
The flag is ignored in notifier commands as they can be executed from the configured channel only.
See Examples for the use cases.
Run @BotKube ping to the channel where BotKube is added. The BotKube will respond you with the PONG message from all the configured clusters. Use --cluster-name
flag to get response from the cluster mentioned in the flag. Else check the deployment in Kubernetes cluster in the botkube namespace.
Depending upon your configuration, you will receive notifications about Kubernetes resources lifecycle events and their health. BotKube bot allows you to enable/disable notifications only from the configured channel. Run /botkubehelp, the bot will reply with the help message about the supported message formats.
Run @BotKube notifier showconfig message from the configured channel where BotKube is added. The bot will reply you with the configuration with which the controller is running.
If you wish to change the configuration, you can update config section in helm/botkube/values.yaml and then run helm upgrade.
$ helm upgrade botkube \
--set config.settings.clustername=<CLUSTER_NAME> \
--set config.settings.allowkubectl=<ALLOW_KUBECTL> \
helm/botkube
OR
You can also modify the controller configuration at runtime. You have to edit the configmap which will also restart the BotKube pod to update mounted configuration in the pod.
$ kubectl edit configmap botkube-configmap -n botkube
This command will open configmap specs in vim editor. Do the required changes, save and exit. The BotKube pod will automatically restart to have these configuration in effect.
If you want to stop receiving notifications from BotKube, run @BotKube notifier stop from the configured channel where BotKube is added. You will no longer receive notifications from the BotKube
If you want to receice notifications from BotKube again, run @BotKube notifier start from the configured channel where BotKube is added.
Run @BotKube notifier status to check status of notifier if running or stopped from the configured channel.
BotKube allows you to manage filters using @BotKube commands
Run @BotKube filters list to get list of available filters and their running status
Run @BotKube filters disable {filter-name} to disable perticular filter to skip checks on resource specs
Run @BotKube filters enable {filter-name} to enable perticular filter to run checks on resource specs
Using Annotations, it is possible -
Annotation botkube.io/disable: true
disables event notifications for the annotated object.
Annotation botkube.io/channel: <channel_name>
sends events notifications of the annotated object to the mentioned channel.
Make sure that you have added BotKube in the channel you want to send notification in