BotKube can be integrated with external apps via Webhooks. A webhook is essentially a POST request sent to a callback URL. So you can configure BotKube to send events on specified URL.
$ helm repo add infracloudio https://infracloudio.github.io/charts
$ helm repo update
$ helm install --version v0.12.4 botkube --namespace botkube \
--set communications.webhook.enabled=true \
--set communications.webhook.url=<WEBHOOK_URL> \
--set config.settings.clustername=<CLUSTER_NAME> \
--set image.repository=infracloudio/botkube \
--set image.tag=v0.12.4 \
infracloudio/botkube
where,
- WEBHOOK_URL is an outgoing webook URL to which BotKube will POST the events
- CLUSTER_NAME is the cluster name set in the incoming messages
Configuration syntax is explained here. Complete list of helm options is documented here.
With the default configuration, BotKube will watch all the resources in all the namespaces for create, delete and error events.
If you wish to monitor only specific resources, follow the steps given below:
Create new file config.yaml and add resource configuration as described on the configuration page.
(You can refer sample config from https://raw.githubusercontent.com/infracloudio/botkube/v0.12.4/helm/botkube/sample-res-config.yaml)
config:
## Resources you want to watch
resources:
- name: v1/pods # Name of the resource. Resource name must be in
# group/version/resource (G/V/R) format
# resource name should be plural
# (e.g apps/v1/deployments, v1/pods)
namespaces: # List of namespaces, "all" will watch all the namespaces
include:
- all
ignore: # List of namespaces to be ignored, used only with include: all
- kube-system # example : include [all], ignore [x,y,z]
events: # List of lifecycle events you want to receive,
# e.g create, update, delete, error OR all
- create
- delete
- error
- name: batch/v1/jobs
namespaces:
include:
- ns1
- ns2
events:
- create
- update
- delete
- error
updateSetting:
includeDiff: true
fields:
- spec.template.spec.containers[*].image
- status.conditions[*].type
Pass the yaml file as a flag to helm install
command.
e.g
$ helm install --version v0.12.4 --name botkube --namespace botkube -f /path/to/config.yaml --set=...other args..
Alternatively, you can also update the configuration at runtime as documented here
$ wget -q https://raw.githubusercontent.com/infracloudio/botkube/v0.12.4/deploy-all-in-one.yaml
Set WEBHOOK_ENABLED=true, WEBHOOK_URL, clustername and update the resource events configuration you want to receive notifications for in the configmap.
where,
- WEBHOOK_URL is an outgoing webook URL to which BotKube will POST the events
- CLUSTER_NAME is the cluster name set in the incoming messages
$ kubectl create -f deploy-all-in-one.yaml
If you have installed BotKube backend using helm, execute following command to completely remove BotKube and related resources from your cluster
$ helm delete --purge botkube
$ kubectl delete -f https://raw.githubusercontent.com/infracloudio/botkube/v0.12.4/deploy-all-in-one.yaml