{"id":19976684,"url":"https://github.com/nccloud/watchtower","last_synced_at":"2025-10-04T06:10:15.695Z","repository":{"id":137361826,"uuid":"611848278","full_name":"NCCloud/watchtower","owner":"NCCloud","description":"Effortlessly monitor your Kubernetes resource activity :rocket:","archived":false,"fork":false,"pushed_at":"2025-04-14T14:22:10.000Z","size":371,"stargazers_count":43,"open_issues_count":1,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-14T15:36:59.960Z","etag":null,"topics":["devops","golang","kubernetes","operator"],"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/NCCloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-09T17:04:46.000Z","updated_at":"2025-03-28T11:25:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"6bcc5fdf-a03b-44af-80e5-275de8006684","html_url":"https://github.com/NCCloud/watchtower","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NCCloud%2Fwatchtower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NCCloud%2Fwatchtower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NCCloud%2Fwatchtower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NCCloud%2Fwatchtower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NCCloud","download_url":"https://codeload.github.com/NCCloud/watchtower/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252283522,"owners_count":21723486,"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","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":["devops","golang","kubernetes","operator"],"created_at":"2024-11-13T03:25:07.875Z","updated_at":"2025-10-04T06:10:10.666Z","avatar_url":"https://github.com/NCCloud.png","language":"Go","readme":"\u003cbr\u003e\u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://abload.de/img/watchtower4nsdoz.png\"\u003e\n    \u003cimg alt=\"logo\" width=\"700\" src=\"https://abload.de/img/watchtower32hej7.png\"\u003e\n\u003c/picture\u003e\n\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/nccloud/watchtower)\n![GitHub Release](https://img.shields.io/github/v/release/nccloud/watchtower)\n[![Go Reference](https://pkg.go.dev/badge/github.com/NCCloud/watchtower.svg)](https://pkg.go.dev/github.com/NCCloud/watchtower)\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/nccloud/watchtower/test.yaml?label=tests)\n![GitHub issues](https://img.shields.io/github/issues/nccloud/watchtower)\n![GitHub License](https://img.shields.io/github/license/nccloud/watchtower)\n\n## 📖 General Information\n\nWatchtower is CRD-based Kubernetes operator that monitors changes to resources and exports them to one or more endpoints,\nlike Slack, Elasticsearch, or your APIs. It listen the events and collect the objects, then filter them based on user-specified criteria, prepares a\ntemplate, and sends the request to the provided destination.\n\n## 🚀 Deployment\n\nThe easiest way to deploy Watchtower to your Kubernetes cluster is by using the Helm chart.\nYou can add our Helm repository and install Watchtower from there.\n\nExample:\n```\nhelm repo add nccloud https://nccloud.github.io/charts\nhelm install watchtower nccloud/watchtower\n```\nAlternatively, you can compile and install Watchtower using any method you choose. Then, you are ready create Watcher custom resources!\n\n## ⚙️ Configuration\n\nWatchtower can be configured by creating and deleting the Watcher CRDs. Examples can be found in de Examples section.\nAlso there are few environment variables that can be found in [config.go](https://github.com/NCCloud/tree/main/common/config.go)\n\n## 📐 Architecture\n\nWatchtower is based on the [controller-runtime](https://github.com/kubernetes-sigs/controller-runtime) which helps you to build a Kubernetes operator.\nIt allows you to dynamically watch for events, filter, render, and send them to your API endpoints with some configurations.\nThe following image will show you the high-level diagram of the architecture.\n\n![Architecture](https://github.com/NCCloud/watchtower/assets/23269628/8016a7ce-0d94-4b82-99d2-093bb7bf2cfd)\n\n## 🛠 Development\n\nYou can easily run Watchtower with a few steps without any 3rd party dependencies:\n1) Create a Kubernetes Cluster or change context for the existing one.\n```bash\nkind create cluster\n```\n2) (Optionally) Create a hook from `https://webhook.site` for testing purposes.\n3) Install CRDs by running ./devops.sh install\n4) (Optionally) Create Watcher resources by checking the examples section.\n4) Run the application;\n```bash\ngo run cmd/manager/main.go\n```\n\n## 📖 Examples\n#### Send Deployment Statuses to Slack (Simple Configuration)\nThis configuration allows you to send available replicas of the deployments in your cluster to a Slack channel via webhook.\n\n```yaml\napiVersion: cloud.spaceship.com/v1alpha1\nkind: Watcher\nmetadata:\n  name: slack-deployment-sender\nspec:\n  source:\n    apiVersion: \"apps/v1\"\n    kind: \"Deployment\"\n  destination:\n    method: \"POST\"\n    urlTemplate: \"YOUR_SLACK_WEBHOOK_URL\"\n    bodyTemplate: |\n      { \"text\": \"{{ .metadata.name }}\" }\n```\n\n#### Send Service Account Tokens to your API (Full Configuration)\nThis configuration allows you to send service account tokens in the default namespace to your API endpoints.\n\n```yaml\napiVersion: cloud.spaceship.com/v1alpha1\nkind: Watcher\nmetadata:\n  name: service-account-token-sender\nspec:\n    source:\n      apiVersion: \"v1\"\n      kind: \"Secret\"\n      concurrency: 10\n    filter:\n      event:\n        create:\n          creationTimeout: \"96h\"\n      #  update:\n      #    generationChanged: true\n      object:\n        name: \"^.*$-token-.*$\"\n        namespace: \"default\"\n        # labels:\n        #  foo: bar\n        # annotations:\n        #  baz: qux\n        # custom:\n        #  template: \"{{ if eq .Status \\\"Approved\\\" }}true{{ end }}\"\n        #  result: \"true\"\n    destination:\n      urlTemplate: \"YOUR_API_ENDPOINT\"\n      bodyTemplate: \"{\\\"ca.crt\\\":\\\"{{ index .data \\\"ca.crt\\\" }}\\\",\\\"token\\\":\\\"{{ index .data \\\"token\\\" }}\\\"}\"\n      method: \"PATCH\"\n      headerTemplate: |\n        \"Content-Type\": \"application/json\"\n```\n\n## 🏷️ Versioning\n\nWe use [SemVer](http://semver.org/) for versioning.\nTo see the available versions, check the [tags on this repository](https://github.com/nccloud/watchtower/tags).\n\n## ⭐️ Documentation\n\nFor more information about the functionality provided by this library, refer to the \n[GoDoc Documentation](http://godoc.org/github.com/nccloud/watchtower) and [CRD Documentation](https://github.com/NCCloud/tree/main/docs/api.md).\n\n## 🤝 Contribution\n\nWe welcome contributions, issues, and feature requests!\u003cbr /\u003e\nIf you have any issues or suggestions, please feel free to check the [issues page](https://github.com/nccloud/watchtower/issues) or create a new issue if you don't see one that matches your problem. \u003cbr\u003e\nAlso, please refer to our [contribution guidelines](CONTRIBUTING.md) for details.\n\n## 📝 License\nAll functionalities are in beta and is subject to change. The code is provided as-is with no warranties.\u003cbr\u003e\n[Apache 2.0 License](./LICENSE)\u003cbr\u003e\n\u003cbr\u003e\u003cbr\u003e\n\u003cimg alt=\"logo\" width=\"75\" src=\"https://avatars.githubusercontent.com/u/7532706\" /\u003e\u003cbr\u003e\nMade with \u003cspan style=\"color: #e25555;\"\u003e\u0026hearts;\u003c/span\u003e by [Namecheap Cloud Team](https://github.com/NCCloud)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnccloud%2Fwatchtower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnccloud%2Fwatchtower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnccloud%2Fwatchtower/lists"}