Botkube allows you to execute
kubectl commands on your Kubernetes cluster. By default, kubectl command execution is disabled. See the Enabling plugin section from the
kubectl configuration documentation.
To execute the
kubectl commands, send message in following format in the channel where Botkube is already added:
@Botkube kubectl [verb] [resource] [flags]
kc are configured as aliases for the
kubectl command. You can use them on par with the
kubectl command. To read more about aliases configuration, see the Alias section.
This command needs to be executed from configured channel.
Interactive kubectl commands builder
Use the interactive
kubectl command builder to construct a
kubectl command just by selecting items from dropdowns. This is especially useful on mobile when typing the command is harder.
The builder includes a resource name dropdown list. This is pre-populated with all the relevant resource names. It's great for discovering resources with the option to select them. E.g. Just grab a Pod name without needing to type or copy-and-paste.
To start the interactive
kubectl command builder, run
@Botkube kubectl from the configured channel where Botkube is added.
You can also use any of the configured aliases - for example, the default
k one, as illustrated below:
Keep in mind that the interactive command builder may not support all the commands that you can run just by typing them directly in a chat window. The following policies are applied:
Under verbs' dropdown, we display verbs that are defined under the
Under resources' dropdown, we display resources that are defined under the
interactiveBuilder.allowed.resourcesconfiguration and are allowed for already selected verb. For example, for the
logsverb we display only
For resources that are namespace-scoped, under namespaces' dropdown, we display
interactiveBuilder.allowed.namespacesif defined. If static namespaces are not specified, plugin needs to have access to fetch all Namespaces, otherwise Namespace dropdown won't be visible at all.
kubectlcommand preview is displayed only if the command that you built is valid, and you have permission to run it.