<p>I am trying to create and mount a volume but getting stuck.</p>

<p>This part creates the storage:</p>

<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvclaim2
spec:
  accessModes:
  - ReadWriteOnce
  storageClassName: managed-premium
  resources:
    requests:
      storage: 5Gi
</code></pre>

<p>The following is a continuation of my deployment section:</p>

<pre><code>volumeMounts:
- name: config
  mountPath: /config
  readOnly: true
args:
- --configfile=/config/traefik.toml


volumes:
  - name: config
    persistentVolumeClaim:
      claimName: pvclaim2
    configMap:
    name: traefik-config
</code></pre>

<p>I keep getting the below error message:</p>

<blockquote>
  <p>The Deployment "traefik-ingress-controller" is invalid:
  spec.template.spec.containers[0].volumeMounts[0].name: Not found:
  "config"</p>
</blockquote>

<p>Any help is appreciated.</p>

<p>UPDATE:</p>

<pre><code>Output from describe pv:

Conditions:
  Type           Status
  PodScheduled   False
Volumes:
  certs:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  pvclaim101
    ReadOnly:   false
  config:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      traefik-conf
    Optional:  false
  traefik-ingress-controller-token-6npxp:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  traefik-ingress-controller-token-6npxp
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  &lt;none&gt;
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason            Age               From               Message
  ----     ------            ----              ----               -------
  Warning  FailedScheduling  1m (x25 over 2m)  default-scheduler  persistentvolumeclaim "pvclaim101" not found
</code></pre>

Rutnet
<p>Looks like you have an indentation it's finding the VolumeMount but not the Volume. Something like this should work:</p>

<pre><code>containers:
- image: your-image
  name: your-containers
  volumeMounts:
  - name: config
    mountPath: /config
    readOnly: true
  args:
  - --configfile=/config/traefik.toml
volumes:
  - name: config
    persistentVolumeClaim:
      claimName: pvclaim2
    configMap:
    name: traefik-config
</code></pre>
