{"id":13448986,"url":"https://github.com/vmware-archive/kubewatch","last_synced_at":"2025-09-28T19:31:07.044Z","repository":{"id":37430247,"uuid":"63135453","full_name":"vmware-archive/kubewatch","owner":"vmware-archive","description":"Watch k8s events and trigger Handlers","archived":true,"fork":false,"pushed_at":"2022-09-17T08:58:53.000Z","size":34079,"stargazers_count":2438,"open_issues_count":107,"forks_count":440,"subscribers_count":33,"default_branch":"master","last_synced_at":"2025-09-22T00:09:04.448Z","etag":null,"topics":["golang","kubernetes","slack"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vmware-archive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-12T07:14:12.000Z","updated_at":"2025-09-21T20:26:19.000Z","dependencies_parsed_at":"2022-07-08T18:43:36.979Z","dependency_job_id":null,"html_url":"https://github.com/vmware-archive/kubewatch","commit_stats":null,"previous_names":["bitnami-labs/kubewatch","skippbox/kubewatch"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/vmware-archive/kubewatch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware-archive%2Fkubewatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware-archive%2Fkubewatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware-archive%2Fkubewatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware-archive%2Fkubewatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vmware-archive","download_url":"https://codeload.github.com/vmware-archive/kubewatch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vmware-archive%2Fkubewatch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277194869,"owners_count":25777177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-27T02:00:08.978Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","kubernetes","slack"],"created_at":"2024-07-31T06:00:27.169Z","updated_at":"2025-09-28T19:31:06.769Z","avatar_url":"https://github.com/vmware-archive.png","language":"Go","funding_links":[],"categories":["Go","kubernetes"],"sub_categories":[],"readme":"## WARNING: Kubewatch is no longer actively maintained by VMware.\n\nVMware has made the difficult decision to stop driving this project and therefore we will no longer actively respond to issues or pull requests. The project will be externally maintained in the following fork: https://github.com/robusta-dev/kubewatch\n\nThank You.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./docs/kubewatch-logo.jpeg\"\u003e\n\u003c/p\u003e\n\n\n[![Build Status](https://travis-ci.org/bitnami-labs/kubewatch.svg?branch=master)](https://travis-ci.org/bitnami-labs/kubewatch) [![Go Report Card](https://goreportcard.com/badge/github.com/bitnami-labs/kubewatch)](https://goreportcard.com/report/github.com/bitnami-labs/kubewatch) [![GoDoc](https://godoc.org/github.com/bitnami-labs/kubewatch?status.svg)](https://godoc.org/github.com/bitnami-labs/kubewatch) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/bitnami-labs/kubewatch/blob/master/LICENSE)\n\n**kubewatch** is a Kubernetes watcher that currently publishes notification to available collaboration hubs/notification channels. Run it in your k8s cluster, and you will get event notifications through webhooks.\n\n# Usage\n```\n$ kubewatch -h\n\nKubewatch: A watcher for Kubernetes\n\nkubewatch is a Kubernetes watcher that publishes notifications\nto Slack/hipchat/mattermost/flock channels. It watches the cluster\nfor resource changes and notifies them through webhooks.\n\nsupported webhooks:\n - slack\n - hipchat\n - mattermost\n - flock\n - webhook\n - smtp\n\nUsage:\n  kubewatch [flags]\n  kubewatch [command]\n\nAvailable Commands:\n  config      modify kubewatch configuration\n  resource    manage resources to be watched\n  version     print version\n\nFlags:\n  -h, --help   help for kubewatch\n\nUse \"kubewatch [command] --help\" for more information about a command.\n\n```\n\n# Install\n\n### Cluster Installation\n#### Using helm:\n\nWhen you have helm installed in your cluster, use the following setup:\n\n```console\nhelm install --name kubewatch bitnami/kubewatch --set='rbac.create=true,slack.channel=#YOUR_CHANNEL,slack.token=xoxb-YOUR_TOKEN,resourcesToWatch.pod=true,resourcesToWatch.daemonset=true'\n```\n\nYou may also provide a values file instead:\n\n```yaml\nrbac:\n  create: true\nresourcesToWatch:\n  deployment: false\n  replicationcontroller: false\n  replicaset: false\n  daemonset: false\n  services: true\n  pod: true\n  job: false\n  node: false\n  clusterrole: true\n  serviceaccount: true\n  persistentvolume: false\n  namespace: false\n  secret: false\n  configmap: false\n  ingress: false\nslack:\n  channel: '#YOUR_CHANNEL'\n  token: 'xoxb-YOUR_TOKEN'\n```\n\nAnd use that:\n\n```console\n$ helm upgrade --install kubewatch bitnami/kubewatch --values=values-file.yml\n```\n\n#### Using kubectl:\n\nIn order to run kubewatch in a Kubernetes cluster quickly, the easiest way is for you to create a [ConfigMap](https://github.com/bitnami-labs/kubewatch/blob/master/kubewatch-configmap.yaml) to hold kubewatch configuration.\n\nAn example is provided at [`kubewatch-configmap.yaml`](https://github.com/bitnami-labs/kubewatch/blob/master/kubewatch-configmap.yaml), do not forget to update your own slack channel and token parameters. Alternatively, you could use secrets.\n\nCreate k8s configmap:\n\n```console\n$ kubectl create -f kubewatch-configmap.yaml\n```\n\nCreate the [Pod](https://github.com/bitnami-labs/kubewatch/blob/master/kubewatch.yaml) directly, or create your own deployment:\n\n```console\n$ kubectl create -f kubewatch.yaml\n```\n\nA `kubewatch` container will be created along with `kubectl` sidecar container in order to reach the API server.\n\nOnce the Pod is running, you will start seeing Kubernetes events in your configured Slack channel. Here is a screenshot:\n\n![slack](./docs/slack.png)\n\nTo modify what notifications you get, update the `kubewatch` ConfigMap and turn on and off (true/false) resources:\n\n```\nresource:\n  deployment: false\n  replicationcontroller: false\n  replicaset: false\n  daemonset: false\n  services: true\n  pod: true\n  job: false\n  node: false\n  clusterrole: false\n  serviceaccount: false\n  persistentvolume: false\n  namespace: false\n  secret: false\n  configmap: false\n  ingress: false\n```\n\n#### Working with RBAC\n\nKubernetes Engine clusters running versions 1.6 or higher introduced Role-Based Access Control (RBAC). We can create `ServiceAccount` for it to work with RBAC.\n\n```console\n$ kubectl create -f kubewatch-service-account.yaml\n```\n\nIf you do not have permission to create it, you need to become an admin first. For example, in GKE you would run:\n\n```\n$ kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=REPLACE_EMAIL_HERE\n```\n\nEdit `kubewatch.yaml`, and create a new field under `spec` with `serviceAccountName: kubewatch`, you can achieve this by running:\n\n```console\n$ sed -i '/spec:/a\\ \\ serviceAccountName: kubewatch' kubewatch.yaml\n```\n\nThen just create `pod` as usual with:\n\n```console\n$ kubectl create -f kubewatch.yaml\n```\n\n### Local Installation\n#### Using go package installer:\n\n```console\n# Download and install kubewatch\n$ go get -u github.com/bitnami-labs/kubewatch\n\n# Configure the notification channel\n$ kubewatch config add slack --channel \u003cslack_channel\u003e --token \u003cslack_token\u003e\n\n# Add resources to be watched\n$ kubewatch resource add --po --svc\nINFO[0000] resource svc configured\nINFO[0000] resource po configured\n\n# start kubewatch server\n$ kubewatch\nINFO[0000] Starting kubewatch controller                 pkg=kubewatch-service\nINFO[0000] Starting kubewatch controller                 pkg=kubewatch-pod\nINFO[0000] Processing add to service: default/kubernetes  pkg=kubewatch-service\nINFO[0000] Processing add to service: kube-system/tiller-deploy  pkg=kubewatch-service\nINFO[0000] Processing add to pod: kube-system/tiller-deploy-69ffbf64bc-h8zxm  pkg=kubewatch-pod\nINFO[0000] Kubewatch controller synced and ready         pkg=kubewatch-service\nINFO[0000] Kubewatch controller synced and ready         pkg=kubewatch-pod\n\n```\n#### Using Docker:\n\nTo Run Kubewatch Container interactively, place the config file in `$HOME/.kubewatch.yaml` location and use the following command.\n\n```\ndocker run --rm -it --network host -v $HOME/.kubewatch.yaml:/root/.kubewatch.yaml -v $HOME/.kube/config:/opt/bitnami/kubewatch/.kube/config --name \u003ccontainer-name\u003e bitnami/kubewatch\n```\n\nExample:\n\n```\n$ docker run --rm -it --network host -v $HOME/.kubewatch.yaml:/root/.kubewatch.yaml -v $HOME/.kube/config:/opt/bitnami/kubewatch/.kube/config --name kubewatch-app bitnami/kubewatch\n\n==\u003e Writing config file...\nINFO[0000] Starting kubewatch controller                 pkg=kubewatch-service\nINFO[0000] Starting kubewatch controller                 pkg=kubewatch-pod\nINFO[0000] Starting kubewatch controller                 pkg=kubewatch-deployment\nINFO[0000] Starting kubewatch controller                 pkg=kubewatch-namespace\nINFO[0000] Processing add to namespace: kube-node-lease  pkg=kubewatch-namespace\nINFO[0000] Processing add to namespace: kube-public      pkg=kubewatch-namespace\nINFO[0000] Processing add to namespace: kube-system      pkg=kubewatch-namespace\nINFO[0000] Processing add to namespace: default          pkg=kubewatch-namespace\n....\n```\n\nTo Demonise Kubewatch container use\n\n```\n$ docker run --rm -d --network host -v $HOME/.kubewatch.yaml:/root/.kubewatch.yaml -v $HOME/.kube/config:/opt/bitnami/kubewatch/.kube/config --name kubewatch-app bitnami/kubewatch\n```\n\n# Configure\n\nKubewatch supports `config` command for configuration. Config file will be saved at `$HOME/.kubewatch.yaml`\n\n```\n$ kubewatch config -h\n\nconfig command allows admin setup his own configuration for running kubewatch\n\nUsage:\n  kubewatch config [flags]\n  kubewatch config [command]\n\nAvailable Commands:\n  add         add webhook config to .kubewatch.yaml\n  test        test handler config present in .kubewatch.yaml\n  view        view .kubewatch.yaml\n\nFlags:\n  -h, --help   help for config\n\nUse \"kubewatch config [command] --help\" for more information about a command.\n```\n### Example:\n\n### slack:\n\n- Create a [slack Bot](https://my.slack.com/services/new/bot)\n\n- Edit the Bot to customize its name, icon and retrieve the API token (it starts with `xoxb-`).\n\n- Invite the Bot into your channel by typing: `/invite @name_of_your_bot` in the Slack message area.\n\n- Add Api token to kubewatch config using the following steps\n\n  ```console\n  $ kubewatch config add slack --channel \u003cslack_channel\u003e --token \u003cslack_token\u003e\n  ```\n  You have an altenative choice to set your SLACK token, channel via environment variables:\n\n  ```console\n  $ export KW_SLACK_TOKEN='XXXXXXXXXXXXXXXX'\n  $ export KW_SLACK_CHANNEL='#channel_name'\n  ```\n\n### flock:\n\n- Create a [flock bot](https://docs.flock.com/display/flockos/Bots).\n\n- Add flock webhook url to config using the following command.\n  ```console\n  $ kubewatch config add flock --url \u003cflock_webhook_url\u003e\n  ```\n  You have an altenative choice to set your FLOCK URL\n\n  ```console\n  $ export KW_FLOCK_URL='https://api.flock.com/hooks/sendMessage/XXXXXXXX'\n  ```\n\n## Testing Config\n\nTo test the handler config by send test messages use the following command.\n```\n$ kubewatch config test -h\n\nTests handler configs present in .kubewatch.yaml by sending test messages\n\nUsage:\n  kubewatch config test [flags]\n\nFlags:\n  -h, --help   help for test\n```\n\n#### Example:\n\n```\n$ kubewatch config test\n\nTesting Handler configs from .kubewatch.yaml\n2019/06/03 12:29:23 Message successfully sent to channel ABCD at 1559545162.000100\n```\n\n## Viewing config\nTo view the entire config file `$HOME/.kubewatch.yaml` use the following command.\n```\n$ kubewatch config view\nContents of .kubewatch.yaml\n\nhandler:\n  slack:\n    token: xoxb-xxxxx-yyyy-zzz\n    channel: kube-watch\n  hipchat:\n    token: \"\"\n    room: \"\"\n    url: \"\"\n  mattermost:\n    channel: \"\"\n    url: \"\"\n    username: \"\"\n  flock:\n    url: \"\"\n  webhook:\n    url: \"\"\nresource:\n  deployment: false\n  replicationcontroller: false\n  replicaset: false\n  daemonset: false\n  services: false\n  pod: true\n  job: false\n  node: false\n  clusterrole: false\n  serviceaccount: false\n  persistentvolume: false\n  namespace: false\n  secret: false\n  configmap: false\n  ingress: false\nnamespace: \"\"\n\n```\n\n\n## Resources\n\nTo manage the resources being watched, use the following command, changes will be saved to `$HOME/.kubewatch.yaml`.\n\n```\n$ kubewatch resource -h\n\nmanage resources to be watched\n\nUsage:\n  kubewatch resource [flags]\n  kubewatch resource [command]\n\nAvailable Commands:\n  add         adds specific resources to be watched\n  remove      remove specific resources being watched\n\nFlags:\n      --clusterrole   watch for cluster roles\n      --cm            watch for plain configmaps\n      --deploy        watch for deployments\n      --ds            watch for daemonsets\n  -h, --help          help for resource\n      --ing           watch for ingresses\n      --job           watch for jobs\n      --node          watch for Nodes\n      --ns            watch for namespaces\n      --po            watch for pods\n      --pv            watch for persistent volumes\n      --rc            watch for replication controllers\n      --rs            watch for replicasets\n      --sa            watch for service accounts\n      --secret        watch for plain secrets\n      --svc           watch for services\n\nUse \"kubewatch resource [command] --help\" for more information about a command.\n\n```\n\n### Add/Remove resource:\n```\n$ kubewatch resource add -h\n\nadds specific resources to be watched\n\nUsage:\n  kubewatch resource add [flags]\n\nFlags:\n  -h, --help   help for add\n\nGlobal Flags:\n      --clusterrole   watch for cluster roles\n      --cm            watch for plain configmaps\n      --deploy        watch for deployments\n      --ds            watch for daemonsets\n      --ing           watch for ingresses\n      --job           watch for jobs\n      --node          watch for Nodes\n      --ns            watch for namespaces\n      --po            watch for pods\n      --pv            watch for persistent volumes\n      --rc            watch for replication controllers\n      --rs            watch for replicasets\n      --sa            watch for service accounts\n      --secret        watch for plain secrets\n      --svc           watch for services\n\n```\n\n### Example:\n\n```console\n# rc, po and svc will be watched\n$ kubewatch resource add --rc --po --svc\n\n# rc, po and svc will be stopped from being watched\n$ kubewatch resource remove --rc --po --svc\n```\n\n# Build\n\n### Using go\n\nClone the repository anywhere:\n```console\n$ git clone https://github.com/bitnami-labs/kubewatch.git\n$ cd kubewatch\n$ go build\n```\nor\n\nYou can also use the Makefile directly:\n\n```console\n$ make build\n```\n\n#### Prerequisites\n\n- You need to have [Go](http://golang.org) (v1.5 or later)  installed. Make sure to set `$GOPATH`\n\n\n### Using Docker\n\n```console\n$ make docker-image\n$ docker images\nREPOSITORY          TAG                 IMAGE ID            CREATED              SIZE\nkubewatch           latest              919896d3cd90        3 minutes ago       27.9MB\n```\n#### Prerequisites\n\n- you need to have [docker](https://docs.docker.com/) installed.\n\n# Contribution\n\nRefer to the [contribution guidelines](docs/CONTRIBUTION.md) to get started.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmware-archive%2Fkubewatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvmware-archive%2Fkubewatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvmware-archive%2Fkubewatch/lists"}