How to create a file while creating(claiming) persistent volume?

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

    # Get the latest image tag at:
    # Inspect the Dockerfile at:
    name: jupyter/datascience-notebook
    tag: 177037d09156

The above yaml is taken from here:

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

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

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: echo "run_id = 'sample' " > /home/jovyan/username/.ipython/profile_default/startup/

    type: dynamic
    extraLabels: {}
    extraVolumes: []
    extraVolumeMounts: []
      subPath: '{username}'
    capacity: 10Gi
    homeMountPath: /home/jovyan
      pvcNameTemplate: claim-{username}{servername}
      volumeNameTemplate: volume-{username}{servername}
      storageAccessModes: [ReadWriteOnce]

The full helm chart is available here, the official one:

I expect the pods when created in the namespace jhub have a file already created.

Source: StackOverflow