<p>Is there a way to specify environment variables in a persistent volume claim in kubernetes for the storage size?</p>
<p>e.g. something like that:</p>
<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: jenkins-pvc
  namespace: devops
spec:
  storageClassName: openebs-local
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: ${JENKINS_PV_SIZE}
</code></pre>

devdanej
<p>Since Operating System wasn't mentioned, I'll assume linux/macos.</p>
<p>You can use <code>envsubst</code> to substitute the variables mentioned in the manifest with the ones set in the Environment and feed the output to <code>kubectl</code>:</p>
<pre><code>envsubst &lt; pvc.yaml | kubectl apply -f -
</code></pre>
