{"id":24576465,"url":"https://github.com/k0rventen/k8s-watchtower","last_synced_at":"2026-02-10T17:32:51.918Z","repository":{"id":158260088,"uuid":"633944409","full_name":"k0rventen/k8s-watchtower","owner":"k0rventen","description":"A monitoring \u0026 observability stack for k8s. Includes apps logs \u0026 ressources usage, node-level metrics and RBAC audit parsing.","archived":false,"fork":false,"pushed_at":"2024-04-08T11:40:55.000Z","size":2071,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-17T13:14:11.240Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/k0rventen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-04-28T16:34:02.000Z","updated_at":"2023-10-27T08:48:59.000Z","dependencies_parsed_at":"2024-01-06T16:40:16.160Z","dependency_job_id":"4411bdec-93a0-445b-a157-b4c7d13717ab","html_url":"https://github.com/k0rventen/k8s-watchtower","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/k0rventen/k8s-watchtower","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0rventen%2Fk8s-watchtower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0rventen%2Fk8s-watchtower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0rventen%2Fk8s-watchtower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0rventen%2Fk8s-watchtower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k0rventen","download_url":"https://codeload.github.com/k0rventen/k8s-watchtower/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0rventen%2Fk8s-watchtower/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268554914,"owners_count":24269065,"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-08-03T02:00:12.545Z","response_time":2577,"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":[],"created_at":"2025-01-23T22:39:13.283Z","updated_at":"2026-02-10T17:32:46.883Z","avatar_url":"https://github.com/k0rventen.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# k8s-watchtower\n\n\nA minimal k8s observability stack which includes: \n- host level \u0026 kubernetes metrics\n  ![host](.github/host_dash.png)\n- RBAC audit log monitoring\n  ![audit](.github/audit_dash.png)\n- workloads metrics \u0026 logs aggregation\n  ![host](.github/apps_dash.png)\n\n## Components:\n\n- `promtail` for log application logs \u0026 k8s audit log aggregation\n- `telegraf` for node-level monitoring \u0026 kubernetes level metrics\n- `influx` \u0026 `loki` for storing metrics and logs \n- `grafana` for the dashboarding\n\n\n## Deployment\n\nYou'll need at least `helm` installed. You can refer to [this section](#enabling-the-audit-log) if you want to enable the audit log beforehand.\n\nAdd the repo to helm and get the default values.yaml file\n```sh\nhelm repo add watchtower https://k0rventen.github.io/k8s-watchtower/\nhelm show values watchtower/watchtower \u003e defaults.yaml\n```\nReview and modify if necessary the values according to your setup (mainly for the audit Log file part)\n\n\nThen deploy (preferably in a separate namespace):\n```sh\nhelm upgrade --install --namespace watchtower --create-namespace watchtower -f defaults.yaml watchtower/watchtower\n```\n\nOnce deployed, port-forward the `grafana` service to your machine\n```sh\nkubectl port-forward -n watchtower svc/watchtower-grafana 3000\n```\n\nthen access the dashboards at `http://localhost:3000`.\n\n\n### Enabling the Audit Log\n\nFor a more thorough documentation on the audit subject, head over to the [kubernetes doc](https://kubernetes.io/docs/tasks/debug/debug-cluster/audit/).\n\nAdd the following arguments to the APIserver config (args self explanatory):\n\n```sh\n--audit-log-maxbackup=3\n--audit-log-maxsize=1024\n--audit-log-maxage=30\n--audit-policy-file=/etc/kubernetes/kube-api-audit-policy.yaml\n--audit-log-path=/var/log/k8s-apiserver-audit.log\n```\n\n\nCreate a new file at the path you specified in the `audit-policy-file` argument, which defines your audit policy:\n\n```yaml\napiVersion: audit.k8s.io/v1\nkind: Policy\nomitStages:\n  - \"RequestReceived\"\n  - \"ResponseStarted\"\nrules:\n- level: Metadata\n  namespaces: [\"app\",\"app2\"]\n```\n\nIn this example we ask the cluster to log every request at the metadata level, in namespaces `app` and `app2`. If you don't specify `namespaces`, all namespaces will be audited. \n\nAgain, you can refer to [the doc](https://kubernetes.io/docs/tasks/debug/debug-cluster/audit/) if you want to tweak your audit policy further.\n\n### Testing on kind\n\nIf you want a quick test environment to assess the stack, you can do so using [kind](https://kind.sigs.k8s.io/):\n\nClone the repo `git clone https://github.com/k0rventen/k8s-watchtower.git` then `cd` into it.\n\nThe `kind/kind-config.yaml` defines a 3 nodes cluster with `audit/policy.yaml` mounted on the control plane.\nYou can launch this cluster using: \n\n```\nkind create cluster --config kind/kind-config.yaml\n```\n\nOnce it's up you can change your kubeconfig to target the new cluster, then apply the helm chart as usual:\n\n```\nhelm upgrade --install --namespace watchtower --create-namespace watchtower -f values.yaml ./\n```\n\nYou can now check on the watchtower dashboards while creating new workloads:\n\n```\nkubectl create deploy --image traefik/whoami --replicas 7 whoami\n```\n\nYou can also check the RBAC dash to visualize API access while creating the resources ! \nThis will launch a pod that will generate a unauthorized request to the kube api:\n```\nkubectl create ns app\nkubectl run -n app -it --rm --image bitnami/kubectl --restart Never rbac-test get pods\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk0rventen%2Fk8s-watchtower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk0rventen%2Fk8s-watchtower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk0rventen%2Fk8s-watchtower/lists"}