<p>I am trying to deploy an app to a Kubernetes cluster. My deployment uses three configMaps as volumeMounts.</p>
<p>However when I apply the deployment it can't seem to find the configMaps.</p>
<p>My deployment.yml looks like this:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: dev-space
  name: my-app-dev
spec:
  replicas: 1
  revisionHistoryLimit: 1
  selector:
    matchLabels:
      name: my-app-dev
  strategy:
    rollingUpdate:
      maxSurge: 100%
      maxUnavailable: 30%
    type: RollingUpdate
  template:
    metadata:
      labels:
        name: my-app-dev
        version: v1
      annotations:
        sla: high
        tier: application
        role: frontend-api
        quality: dev
    spec:
      containers:
      - name: my-app
        env:
        - name: ENVIRONMENT
          value: dev
        - name: SAMPLE_FILE
          value: sample.yml
        - name: SAMPLE_FILE2
          value: sample2.yml
        image: my-app:1.0
        ports:
        - containerPort: 8000
          protocol: TCP
        livenessProbe:
          httpGet:
            path: /health
            port: 9000
          initialDelaySeconds: 11
          timeoutSeconds: 3
        readinessProbe:
          httpGet:
            path: /health
            port: 9000
          initialDelaySeconds: 11
          timeoutSeconds: 3
        volumeMounts:
          - name: sample-volume
            mountPath: /path
            readOnly: true
          - name: sample-volume1
            mountPath: /path1
            readOnly: true
          - name: sample-volume2
            mountPath: /path2
            readOnly: true
      nodeSelector:
        tier: app
      imagePullSecrets:
      - name: img-secret
      volumes:
        - name: &quot;sample-volume&quot;
          configMap:
            name: &quot;sample-volume-dev-my-app&quot;
        - name: &quot;sample-volume1&quot;
          configMap:
            name: &quot;sample-volume1-dev-my-app&quot;
        - name: &quot;sample-volume2&quot;
          configMap:
            name: &quot;sample-volume2-dev-my-app&quot;
</code></pre>
<p>When I apply the deployment I get the following errors:</p>
<pre><code>Warning  FailedMount   4m (x6 over 5m)  kubelet, server.org.local  MountVolume.SetUp failed for volume &quot;sample-volume&quot; : configmaps &quot;sample-volume-dev-my-app&quot; not found
Warning  FailedMount   4m (x6 over 5m)  kubelet, server.org.local  MountVolume.SetUp failed for volume &quot;sample-volume1&quot; : configmaps &quot;sample-volume1-dev-my-app&quot; not found
Warning  FailedMount   4m (x6 over 5m)  kubelet, server.org.local  MountVolume.SetUp failed for volume &quot;sample-volume2&quot; : configmaps &quot;sample-volume2-dev-my-app&quot; not found
</code></pre>
<p>Is there something wrong with my configuration? What could be the issue?</p>

<p>You either have not created the config maps or you have created them in a different namespace than where you are deploying the application.</p>
<pre><code>kubectl get cm -A
</code></pre>
<p>Above command will list all config maps in all namespaces. Check if a config map with name <code>sample-volume-dev-my-app</code> exists and in which namespace.</p>
