0.0.0 • Published 2 years ago

@smallcase/cdk8s-botkube v0.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

CDK8S BotKube

cdk8s-botkube is an open-source construct library for cdk8s to deploy a configurable instance of BotKube to your Kubernetes cluster. BotKube is a messaging bot for monitoring and debugging Kubernetes clusters. You provide the configuration for BotKube, our construct library does the rest of the magic.

Official website

Installation

Install using NPM:

npm install @smallcase/cdk8s-botkube

Using yarn

yarn add @smallcase/cdk8s-botkube

Configuration Helper

PropertyTypeDefaultDescription
secretNamestringbotkube-communication-secretYour BotKube communication secret name (Read below to see how to define your secret)
configMapDatastring./configmap.yamlYAML formatted string defining your BotKube monitoring config (Read below to see how to define your config)
replicasnumber1Number of pod replicas for deployment
nodeSelector{ key: string: string }{}Node selectors for the BotKube deployment
tolerationsk8s.Toleration[][]Tolerations for the BotKube deployment

Setting Up Secrets:

Since the communication configuration contains sensitive information like webhook and application tokens we recommend you deploy the configuration as a secret.

Template:

apiVersion: v1
kind: Secret
metadata:
  name: botkube-communication-secret
  labels:
    app: botkube
type: Opaque
stringData:
  comm_config.yaml: |
    ...

Fill in the communication secret as per your requirements, have a look at BotKube's official documentation here to get an idea of the syntax.

Setting Up the Resource Config

You can customize alerts from BotKube as per your needs by tweaking its config. You can leave this field empty and a default config will be added, or you can specify a custom YAML config. See resource config syntax here.

Using the construct

Import the library in your CDK8s project and pass the necessary parameters to the construct.

Example:

new BotKube(this, 'botkube-default', {
  secretName: 'my-secret-name',
  configMapData: 'Foo',
  replicas: 2
});