BotKube controller reads configurations from config.yaml file placed at CONFIG_PATH

config.yaml syntax

The configuration file contains,

  • Resource list you want to watch
  • The type of events you want to get notifications about
  • Way to skip filter runs
  • Slack access configuration
  ## Resources you want to watch
    - name: NAME_OF_THE_RESOURCE   # Name of the resources e.g pods, deployments, ingresses, etc. (Resource name must be in plural form)
      namespaces:                  # List of namespaces, "all" will watch all the namespaces
        - all
      events:                      # List of lifecycle events you want to receive, e.g create, update, delete OR all
        - create
        - delete
    - name: secrets
        - kube-system
        - create
        - delete

  # K8S error/warning events you want to receive for the configured resources
      - normal
      - warning

  # Check true if you want to receive recommendations
  # about the best practices for the created resource
  recommendations: true
  # Channels configuration
      channel: 'SLACK_CHANNEL'
      token: 'SLACK_API_TOKEN'

  # Setting to support multiple clusters
    # Cluster name to differentiate incoming messages
    clustername: not-configured
    # Set true to enable kubectl commands execution by BotKube on the cluster
    allowkubectl: false

The default configuration can be found at:

As of now, BotKube can watch following types of resources:

  • pods
  • nodes
  • services
  • namespaces
  • replicationcontrollers
  • persistentvolumes
  • persistentvolumeclaims
  • secrets
  • configmaps
  • deployments
  • daemonsets
  • replicasets
  • ingresses
  • jobs
  • roles
  • rolebindings
  • clusterroles
  • clusterrolebindings

Updating the configuration at runtime

You can update the configuration and use helm upgrade to update configuration values for the BotKube.

You can also change values directly in ConfigMap - which is not reccomended but is great for quick experimentation. 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 an editor. Do the required changes, save and exit. The BotKube pod will automatically restart to have these configuration in effect.