Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/growse/k8s-version-checker
Checks pods and other resources on a Kubernetes cluster for new image tags or updates to exsting tags
https://github.com/growse/k8s-version-checker
Last synced: about 2 months ago
JSON representation
Checks pods and other resources on a Kubernetes cluster for new image tags or updates to exsting tags
- Host: GitHub
- URL: https://github.com/growse/k8s-version-checker
- Owner: growse
- License: mit
- Created: 2019-08-04T14:09:33.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T14:29:23.000Z (almost 2 years ago)
- Last Synced: 2024-11-04T12:47:00.618Z (3 months ago)
- Language: Python
- Homepage:
- Size: 58.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# About
`k8s-version-checker` is a simple script that looks for updated tags of image digests on a kubernetes (k8s) cluster.
# Running `k8s-version-checker`
`k8s-version-checker` can either be run locally where a `~/.kube/config` environment is available, or it can be run on a k8s cluster itself. If the latter, then a common deployment pattern is to use a `CronJob` to scheulde the execution periodically.
An example manifest with the relevent roles and permissions is present in `k8s-cron-job.yml`.
Usage: version-checker [OPTIONS]
Checks a kubernetes cluster to see if any running pods, cron jobs or
deployments have updated image tags or image digests on their
repositories.
Can be run either external to a cluster (requires `~/.kube/config` to be
setup correctly) or within a cluster as a pod. In the latter case,
notifications about available updates will be posted to a webhook.
This script can be figured using annotations on the pods themselves. Pods
can be ignored with:
`growse.com/version-checker-ignore: "true"`
And can have their elgiable tags scroped with a regular expression:
`growse.com/version-checker-tag-regex: "^v.+?-amd64$"
Options:
--debug Enable debug logging
--namespace TEXT Only look in this namespace
-h, --help Show this message and exit.# Testing
`pytest` is used, and the `pytest-cov` plugin should be available:
pytest --cov=version_checker tests/
# TODO
- [ ] Notifications. Somehow. K8s events?
- [x] Inspect cron job resources
- [ ] Store state of notifications between invocations
- [ ] Tests for version pattern matching