<p>I have three environments - QA, Staging, Production.
Each one has its own credentials.properties file</p>

<p>Right now I just have one secret and it's referenced and mounted in my yaml file as follows</p>

<pre><code>          - name: identity-service-secret-here-credentials-volume
            mountPath: "/root/.secrets"
.
.
.
      - name: identity-service-secret-here-credentials-volume
        secret:
          secretName: identity-service-secret-here-credentials
</code></pre>

<p>I want it to do the equivalent of</p>

<pre><code>if(env = QA)
  secretName = secret-qa
if(env = Staging)
  secretName = secret-staging
if(env = Prod)
  secretName = secret-prod
</code></pre>

kellyfj
<p>It is bad design (also from a security perspective) to have helm control structures directives to manage deployments across <code>dev, stage and prod</code> in one YAML file.</p>

<p>It best to manage distinct k8s objects for respective deployments required in a distinct environment.</p>

<p>It may be necessary to maintain a distinct Secret in each stage of the pipeline or to make modifications to it as it traverses through the pipeline. Also, take care that if you are storing the Secret as JSON or YAML in an SCM, there is some form of encryption to protect the sensitive information may be warranted.</p>
