<p>we have 9 microservices in our application. In this all the services have same yaml manifest file(deployment, service and configmap(to supply environment variable to containers)).</p>
<p>But when we try to get it as helm template. We couldn't able to pass different environment variable for different services.</p>
<p>We have been using same template by having different values.yaml file for different service. Is there any way to support different environment variables using same configmap.</p>

<p>a helm chart acts as a collection of templates, which you can (re-)use to deploy multiple services, especially in a microservices context.</p>
<p>you configure different deployments (and therefore different environments) with the same helm chart by providing values-files during installation, which contain the configuration that should be applied during installation.</p>
<p>values.yaml in the helm chart folder:</p>
<pre><code>service:
  port: 123
</code></pre>
<p>microservice-a-values.yaml provided during installation:</p>
<pre><code>service:
  port: 456
</code></pre>
<p>configmap template in the helm charts templates/ folder:</p>
<pre><code>---
apiVersion: v1
kind: ConfigMap
metadata:
  name: &quot;{{ .Release.Name }}&quot;
data:
  port: {{ .Values.service.port }}
</code></pre>
<p>to run the installation and actually use the microservice-a-values.yaml, provide it when calling the helm install:</p>
<pre><code>helm upgrade --install microservice-a --values microservice-a-values.yaml
</code></pre>
<p>remember that there is a &quot;hierarchy&quot; of provided values files: the last one wins and overwrites the previous ones.</p>
