'Deploy same deployment several times with different values in Helm

I have a situation in which I have an image which I need to deploy to an OpenShift cluster 3 instances, i.e. 3 containers of the same image.

Each container should run with a different configuration (e.g. port, env vars, etc.). Each of these containers should be accessible as a separate service.

This means that I need a separate Deployment resource for each of them.

I'm using Helm to do this, and currently I have this setup:

- Chart.yaml
- values1.yaml
- values2.yaml
- values3.yaml
- Values.yaml
- deployment.yaml
- configmap.yaml
- service.yaml

Currently what I do is, that I run helm install 3 times to achieve this:

$ helm install first_deployment -f values1.yaml 
$ helm install second_deployment -f values2.yaml 
$ helm install third_deployment -f values3.yaml 

I want to be able to achieve the same goal with only 1 helm install

So basically what I would like is that helm will run apply to my deployment 3 times, each time with a different set of variables, i.e. different configuration.

My motivation for this is that I want all the deployments to appear in the same Helm Release in my OpenShift cluster.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source