kubewatch

by joaquinito2051

Helm chartv0.8.0App 0.0.4

Kubewatch notifies your slack rooms when changes to your cluster occur

About this chart

kubewatch

kubewatch is a Kubernetes watcher that currently publishes notification to Slack. Run it in your k8s cluster, and you will get event notifications in a slack channel.

TL;DR;

$ helm install <helm-repo>/kubewatch

$ helm install stable/kubewatch

Introduction

This chart bootstraps a kubewatch deployment on a Kubernetes cluster using the Helm package manager.

Installing the Chart

To install the chart with the release name my-release:

$ helm install <helm-repo>/kubewatch --name my-release

$ helm install stable/kubewatch --name my-release The command deploys kubewatch on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the kubewatch chart and their default values.

ParameterDescriptionDefault
global.imageRegistryGlobal Docker image registrynil
global.imagePullSecretsGlobal Docker registry secret names as an array[] (does not add image pull secrets to deployed pods)
affinitynode/pod affinitiesNone
image.registryImage registrydocker.io
image.repositoryImage repositorybitnami/kubewatch
image.tagImage tag{VERSION}
image.pullPolicyImage pull policyAlways
nodeSelectornode labels for pod assignment{}
podAnnotationsannotations to add to each pod{}
podLabelsadditional labesl to add to each pod{}
replicaCountdesired number of pods1
rbac.createIf true, create & use RBAC resourcestrue
serviceAccount.createIf true, create a serviceAccounttrue
serviceAccount.nameexisting ServiceAccount to use (ignored if rbac.create=true)``
resourcespod resource requests & limits{}
slack.enabledEnable Slack notificationstrue
slack.channelSlack channel to notify""
slack.tokenSlack API token""
hipchat.enabledEnable HipChat notificationsfalse
hipchat.urlHipChat URL""
hipchat.roomHipChat room to notify""
hipchat.tokenHipChat token""
mattermost.enabledEnable Mattermost notificationsfalse
mattermost.channelMattermost channel to notify""
mattermost.usernameMattermost user to notify""
mattermost.urlMattermost URL""
flock.enabledEnable Flock notificationsfalse
flock.urlFlock URL""
webhook.enabledEnable Webhook notificationsfalse
webhook.urlWebhook URL""
tolerationsList of node taints to tolerate (requires Kubernetes >= 1.6)[]
namespaceToWatchnamespace to watch, leave it empty for watching all""
resourcesToWatchlist of resources which kubewatch should watch and notify slack{pod: true, deployment: true}
resourcesToWatch.podwatch changes to Podstrue
resourcesToWatch.deploymentwatch changes to Deploymentstrue
resourcesToWatch.replicationcontrollerwatch changes to ReplicationControllersfalse
resourcesToWatch.replicasetwatch changes to ReplicaSetsfalse
resourcesToWatch.daemonsetwatch changes to DaemonSetsfalse
resourcesToWatch.serviceswatch changes to Servicesfalse
resourcesToWatch.jobwatch changes to Jobsfalse
resourcesToWatch.persistentvolumewatch changes to PersistentVolumesfalse

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
$ helm install <helm-repo>/kubewatch --name my-release \
  --set=slack.channel="#bots",slack.token="XXXX-XXXX-XXXX"

$ helm install stable/kubewatch --name my-release \

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

$ helm install <helm-repo>/kubewatch --name my-release -f values.yaml

$ helm install stable/kubewatch --name my-release -f values.yaml

Tip: You can use the default values.yaml

Create a Slack bot

Open https://my.slack.com/services/new/bot to create a new Slack bot. The API token can be found on the edit page (it starts with xoxb-).

Invite the Bot to your channel by typing /join @name_of_your_bot in the Slack message area.

Deploy kubewatch with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kubewatch on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartkubewatch is pinned at v0.8.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply