Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cartermckinnon/k8s-deployment-updater
Update the image in a Kubernetes deployment.
https://github.com/cartermckinnon/k8s-deployment-updater
Last synced: 18 days ago
JSON representation
Update the image in a Kubernetes deployment.
- Host: GitHub
- URL: https://github.com/cartermckinnon/k8s-deployment-updater
- Owner: cartermckinnon
- Created: 2022-06-10T05:53:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-20T04:00:52.000Z (over 2 years ago)
- Last Synced: 2024-06-19T22:54:41.036Z (5 months ago)
- Language: Go
- Homepage:
- Size: 57.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kubernetes deployment updater
This is a silly little program that will update an `image` in a Kubernetes deployment to the latest digest available from an upstream image.
For example, you may want a deployment to be regularly updated to use the current digest referred to by a `latest` tag.
Use this with caution. You likely only want this for a truly stateless application that does not serve critical production traffic.
#### On the command line:
```
usage: k8s-deployment-updater DEPLOYMENT_NAME IMAGE_REFarguments:
DEPLOYMENT_NAME
Name of the deployment to be updated
IMAGE_REF
Reference of the upstream imageoptions:
-in-cluster
Use in-cluster Kubernetes authentication chain
-kubeconfig string
(optional) absolute path to the kubeconfig file (default "$HOME/.kube/config")
-namespace string
Namespace containing the targeted deployment (default "default")
```#### In your Kubernetes cluster:
0. Take a look at [example.yaml](example.yaml).
1. You probably want to schedule regular (but not obsessive) checks for updates via a `CronJob`.
2. Make sure you enable in-cluster authentication with your Kubernetes control plane, and that you have a service account, role, and role binding to allow mutation of deployments.
3. You may need to mount an authentication token for your container registry, via a `dockerconfigjson` secret.