<p>I have multiple apps based on the same chart deployed with Helm. Let's imagine you deploy your app multiple times with different configurations:</p>
<pre class="lang-sh prettyprint-override"><code>helm install myapp-01 mycharts/myapp
helm install myapp-02 mycharts/myapp
helm install myapp-03 mycharts/myapp
</code></pre>
<p>And after I update the chart files, I want to update all the releases, or maybe a certain range of releases. I managed to create a PoC script like this:</p>
<pre class="lang-sh prettyprint-override"><code>helm list -f myapp -o json | jq -r '.[].name' | while read i; do helm upgrade ${i} mycharts/myapp; done
</code></pre>
<p>While this works I will need to do a lot of things to have full functionality and error control.
Is there any CLI tool or something I can use in a CI/CD environment to update a big number of releases (say hundreds of them)? I've been investigating Rancher and Autohelm, but I couldn't find such functionality.</p>

jmservera
<p>Thanks to the tip provided by <a href="https://stackoverflow.com/users/213269/jonas">@Jonas</a> I've managed to create a simple structure to deploy and update lots of pods with the same image base.</p>
<p>I created a folder structure like this:</p>
<pre><code>├── kustomization.yaml
├── base
│   ├── deployment.yaml
│   ├── kustomization.yaml
│   ├── namespace.yaml
│   └── service.yaml
└── overlays
    ├── one
    │   ├── deployment.yaml
    │   └── kustomization.yaml
    └── two
        ├── deployment.yaml
        └── kustomization.yaml
</code></pre>
<p>So the main trick here is to have a <code>kustomization.yaml</code> file in the main folder that points to every app:</p>
<pre class="lang-yaml prettyprint-override"><code>resources:
- overlays/one
- overlays/two
namePrefix: winnp-
</code></pre>
<p>Then in the <code>base/kustomization.yaml</code> I point to the base files:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
  - service.yaml
  - deployment.yaml
  - namespace.yaml
</code></pre>
<p>And then in each app I use namespaces, sufixes and commonLabels for the deployments and services, and a patch to rename the base namespace:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: ns-one
nameSuffix: &quot;-one&quot;

commonLabels:
  app: vbserver-one

bases:
- ../../base

patchesStrategicMerge:

 - deployment.yaml

patches:
- target:
    version: v1 # apiVersion
    kind: Namespace
    name: base
  patch: |-
    - op: replace
      path: /metadata/name
      value: ns-one
</code></pre>
<p>Now, with a simple command I can deploy or modify all the apps:</p>
<pre class="lang-bash prettyprint-override"><code>kubectl apply -k .
</code></pre>
<p>So to update the image I only have to change the <code>deployment.yaml</code> file with the new image and run the command again.</p>
<p>I uploaded a full example of what I did in this <a href="https://github.com/jmservera/legacyvb6ink8s/tree/main/aks/kustomize" rel="nofollow noreferrer">GitHub repo</a></p>
