<p>Is there any CLI tools or libraries that allow to update container images (and other parameters) in K8S YAML/JSON configuration files?</p>

<p>For example, I have this YAML:</p>

<pre><code>apiVersion: apps/v1
kind: Deployment
&lt;...&gt;
spec:
  template:
    spec:
      containers:
        - name: dmp-reports
          image: example.com/my-image:v1
&lt;...&gt;
</code></pre>

<p>And I want to automatically update the image for this deployment in this file (basically, this is necessary for the CI/CD system).</p>

<p>We have the same issue on the <a href="https://jenkins-x.io/" rel="nofollow noreferrer">Jenkins X</a> 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 <code>pom.xml, package.json, Dockerfiles, helm charts</code> etc.</p>

<p>We use a simple CLI tool called <a href="https://github.com/jenkins-x/updatebot" rel="nofollow noreferrer">UpdateBot</a> 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 <a href="https://github.com/pulls?q=is%3Apr+archived%3Afalse+user%3Ajenkins-x+is%3Aclosed+label%3Aupdatebot" rel="nofollow noreferrer">current Pull Requests that UpdateBot has generated on the Jenkins X organisation repositories</a></p>

<p>Then here's how we update Dockerfiles / helm charts as we release, say, new base images:
<a href="https://github.com/jenkins-x/builder-base/blob/master/jx/scripts/release.sh#L28-L29" rel="nofollow noreferrer">https://github.com/jenkins-x/builder-base/blob/master/jx/scripts/release.sh#L28-L29</a></p>
