<p>I have certain requirements where volumeMounts: should be an optional field. </p>

<pre><code>spec:
      volumes:
        -
          name: aaa
          secret:
            secretName: aaa-certs
      containers:
        -
          name: my-celery
          volumeMounts:
            -
              name: aaa
              mountPath: /tmp/aaa_certs
              readOnly: true
</code></pre>

<p>If secret is present then it will mount, else create an empty folder. Is this possible </p>

<p>Secret volumes can be marked as optional using tag "optional: true", and result in empty directories if the associated secret doesn't exist, rather than blocking pod startup.</p>

<p>Example:</p>

<pre><code>spec:
      volumes:
        -
          name: aaa
          secret:
            secretName: aaa-certs
            optional: true
      containers:
        -
          name: my-celery
          volumeMounts:
            -
              name: aaa
              mountPath: /tmp/aaa_certs
              readOnly: true
</code></pre>
