Reputation: 283
Is there any CLI tools or libraries that allow to update container images (and other parameters) in K8S YAML/JSON configuration files?
For example, I have this YAML:
apiVersion: apps/v1
kind: Deployment
<...>
spec:
template:
spec:
containers:
- name: dmp-reports
image: example.com/my-image:v1
<...>
And I want to automatically update the image for this deployment in this file (basically, this is necessary for the CI/CD system).
Upvotes: 2
Views: 143
Reputation: 9198
We have the same issue on the Jenkins X project where we have many git repositories and as we change things like libraries or base docker images we need to change lots of versions in pom.xml, package.json, Dockerfiles, helm charts
etc.
We use a simple CLI tool called UpdateBot which automates the generation of Pull Requests on all downstream repositories. We tend to think of this as Continuous Delivery for libraries and base images ;). e.g. here's the current Pull Requests that UpdateBot has generated on the Jenkins X organisation repositories
Then here's how we update Dockerfiles / helm charts as we release, say, new base images: https://github.com/jenkins-x/builder-base/blob/master/jx/scripts/release.sh#L28-L29
Upvotes: 2