<p>I have a rather peculiar use case. Specifically, prior to the deployment of my statefulset I am deploying a ConfigMap which contains an environment variable setting (namely RECREATE_DATADIR) which instructs the pod's container to create a new data structure on the file system.
However, during the typical lifetime of the container the data structure should NOT be recreated. Hence, right after the pod is successfully running, I am changing the ConfigMap and then reapply it. Hence - if the pod ever fails, it won't recreate the data directory structure when it respawns.</p>
<p>How can I achieve this same result using Helm charts?</p>

Alex Mang
<p>You can create a <code>job</code> as part of your helm chart, with the <code>post-install</code> helm hook which will have configmap edit permissions, will use a kubectl image (<code>bitnami/kubectl</code> for example), and it will patch the configmap to false using kubectl commands.</p>
