<p>Is it possible to keep the volume mount configurable, such that I can choose to mount any specific persistent volume claim during POD creation?</p>

<p>I have a list of volume claims and I’m looking to configure my PodSpec in a way that will let me decide which claim to use as a volume mount without having to modify the YAML every time. </p>

<p>It is fine with me to run an additional kubectl command on the cluster before creating a new pod.</p>

divyanshm
<p>Based on your description here and in slack <a href="https://kubernetes.slack.com/archives/C09NXKJKA/p1559740826069800" rel="nofollow noreferrer">https://kubernetes.slack.com/archives/C09NXKJKA/p1559740826069800</a></p>

<p>Firstly, there is no interactive way to deploy yamls which will let you choose during run-time. Yaml are delarative therefore, you declare and then apply. NO questions asked, unless you have syntax errors!</p>

<p>Secondly, if you are looking for a kubectl command which the Sysadm will apply on production. Then right after deploying the dev yaml, you can use a (something similar to your use case) <code>kubectl patch</code> [resource name example pod] <code>--patch '{"spec":{"volumes":[{"name": "glusterfsvol","persistentVolumeClaim": {"claimName": "nameOfNewVolumeClaim"}}]}}'</code></p>

<p>Lastly, What would be more concrete in your use case is to use a different <a href="https://kubernetes.io/docs/concepts/storage/storage-classes/" rel="nofollow noreferrer">storageclass</a> in your dev and another one in production. In that you can have the same pvc which point to a different storage as it is defined in that k8s cluster. <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#dynamic" rel="nofollow noreferrer">refer docs</a></p>
