<p>I want to create a file at a certain path. The docker image that is being used is from the file:</p>

<pre><code>singleuser:
  image:
    # Get the latest image tag at:
    # https://hub.docker.com/r/jupyter/datascience-notebook/tags/
    # Inspect the Dockerfile at:
    # https://github.com/jupyter/docker-stacks/tree/master/datascience-notebook/Dockerfile
    name: jupyter/datascience-notebook
    tag: 177037d09156
</code></pre>

<p>The above yaml is taken from here: <a href="https://zero-to-jupyterhub.readthedocs.io/en/latest/user-environment.html" rel="nofollow noreferrer">https://zero-to-jupyterhub.readthedocs.io/en/latest/user-environment.html</a></p>

<p>JuPyterHub creates a new pod for each user in the scheme <code>singleUser</code>. I want to create a file as soon as there is a creation of the new volume.</p>

<p>I tried reading docs and other relevant questions but none of them addressed this issue.</p>

<p>Below is the snippet where the storage logic is defined. Each user gets a new pvc and I want to create a new file in this pvc whenever it is created. I already have the homeMountPath and the username in the below code snippet, I don't know how to write a file - something on the similar lines as: <code>echo "run_id = 'sample' " &gt; /home/jovyan/username/.ipython/profile_default/startup/aviral.py</code> </p>

<pre><code>storage:
    type: dynamic
    extraLabels: {}
    extraVolumes: []
    extraVolumeMounts: []
    static:
      pvcName:
      subPath: '{username}'
    capacity: 10Gi
    homeMountPath: /home/jovyan
    dynamic:
      storageClass:
      pvcNameTemplate: claim-{username}{servername}
      volumeNameTemplate: volume-{username}{servername}
      storageAccessModes: [ReadWriteOnce]
</code></pre>

<p>The full helm chart is available here, the official one: <a href="https://jupyterhub.github.io/helm-chart/jupyterhub-0.8.2.tgz" rel="nofollow noreferrer">https://jupyterhub.github.io/helm-chart/jupyterhub-0.8.2.tgz</a></p>

<p>I expect the pods when created in the namespace <code>jhub</code> have a file already created.</p>

Aviral Srivastava
<p>you can look at configmap object. files from configmap can be mounted as volume inside container.</p>
