Skip to main content
Version: 0.18

Kubectl

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]

By default, k and 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:

kubectl command builder

The following policies are applied:

  • Verbs, resource types and namespace dropdowns are narrowed down to the kubectl permissions in a given channel,
  • The kubectl command preview is displayed only if the command that you built is valid,
  • For resources that are namespace-scoped, the Namespace defined in executors.{alias}.kubectl.defaultNamespace is used. If not set, the default Namespace is selected.
info

Actionable notifications are only available for the Slack integration that supports interactive messages.