<p>I have several files stored as Kubernetes secrets. I can access one of them, but obviously I need them all. How do I access all of them? I tried this but they seem to be overwriting each other.</p>
<pre><code>// In deployment
volumes:
- name: my-secret-volume
  secret:
    secretName: some-file.yaml
- name: my-secret-volume
  secret:
    secretName: another-file.yaml
...
volumeMounts:
- name: my-secret-volume
  mountPath: /var/config
  readOnly: true
</code></pre>

Martin01478
<p>Volumes names should be different. Also you should only give the secret name not the yaml. You can use like below:</p>
<pre><code>volumes:
- name: my-secret-volume1
  secret:
    secretName: some-secret
- name: my-secret-volume2
  secret:
    secretName: another-secret
...
volumeMounts:
- name: my-secret-volume1
  mountPath: /var/config
  readOnly: true
- name: my-secret-volume2
  mountPath: /var/config
  readOnly: true
</code></pre>
