title: How to merge two configmaps using volume mount in kubernetes
body: <p>I am having two different config maps <strong>test-configmap</strong> and <strong>common-config</strong>. I tried to mount them at the same location, but one config map overwrote the other. Then I read about <code>subPath</code> and did not work.</p>
  
  <p>deploy.yaml</p>
  
  <pre><code>apiVersion: apps/v1beta1 # for versions before 1.8.0 use apps/v1beta1
  kind: Deployment
  metadata:
    name: testing
  spec:
    replicas: 1
    template:
      metadata:
        name: testing
        labels:
          app: testing
      spec:
        containers:
        - name: testing-container
          image: testing
          imagePullPolicy: IfNotPresent
        ports:
        - containerPort: __PORT__
        volumeMounts:
        - name: commonconfig-volume
          mountPath: /usr/src/app/config/test.config
          subPath: test.config
      volumes:
        - name: commonconfig-volume
          configMap:
            name: test-configmap
        - name: commonconfig-volume
          configMap:
            name: common-config
  </code></pre>
  
  <p>Error :</p>
  
  <p><code>The Deployment "testing" is invalid: spec.template.spec.volumes[1].name: Duplicate value: "commonconfig-volume"</code></p>
  
  <p>I am not sure if merging two config map achievable of not. And if yes then how should I do it.</p>