<p>I've mounted the configmap in my deployment file but conditionally create a configmap through oc create configmap command during deployment. Is there a way I could mount the path in my deployment.yaml but when configmap is not there it can ignore that error and bring up the pods any how.</p>

<p>Please refer to ConfigMapVolumeSource  and <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.16/#configmapvolumesource-v1-core" rel="nofollow noreferrer">ValidatingWebhookConfiguration</a> you
can find optional parameter:</p>
<pre><code>Specify whether the ConfigMap or it's keys must be define
</code></pre>
<p>So please try and add &quot;<code>optional: true</code>&quot; in your volumes <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#populate-a-volume-with-data-stored-in-a-configmap" rel="nofollow noreferrer">configmap</a> properties:</p>
<pre><code>volumes:
    - name: config-volume
      configMap:
        # Provide the name of the ConfigMap containing the files you want
        # to add to the container
        name: special-config
        optional: true
</code></pre>
<p>Note:</p>
<blockquote>
<p><a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#restrictions" rel="nofollow noreferrer">Restrictions</a>:</p>
<p>You must create a ConfigMap before referencing it in a Pod specification (<strong>unless you mark the ConfigMap as “optional”</strong>). If you reference a ConfigMap that doesn’t exist, the Pod won’t start. Likewise, references to keys that don’t exist in the ConfigMap will prevent the pod from starting.</p>
</blockquote>
<p>Please let me know if it helped.</p>
