Getting volumeMount to work with singleuser.initContainers inside Z2JH stack

I’m trying to get a busybox initContainer run to change some permissions on the user $HOME folders that are created. Below is my singleuser.initContainers section of my config.yaml in Z2JH stack

initContainers:

  • name: grant-group-write-on-the-home-init
    image: busybox
    command: [“sh”, “-c”, “chmod 775 /home/jovyan”]
    securityContext:
    runAsUser: 1000
    volumes:
    • name: home-for-busybox
      hostPath:
      path: /clusterfs/minos/kubestorage/{username}
      volumeMounts:
    • name: home-for-busybox
      mountPath: /home/jovyan

With this when the hub tries to spawn I see this message:

“Pod “jupyter-kmuriki” is invalid: spec.initContainers[0].volumeMounts[0].name: Not found: “home-for-busybox””,“reason”:“Invalid”

Any clue on what I’m missing ? Below is the remaining singleuser.storage section

storage:
type: hostPath
extraVolumes:
- name: home
hostPath:
path: /clusterfs/minos/kubestorage/{username}
- name: common-data
hostPath:
path: /clusterfs/minos/public_datasets
extraVolumeMounts:
- name: home
mountPath: /home/jovyan
- name: common-data
mountPath: /home/jovyan/data
readOnly: True

Let me know if any of you have any suggestions.

Thanks,
Krishna.

I guess I dint have to define a new name ‘home-for-busybox’ instead could have just used the ‘home’ volume defined in the extraVolumes section and that just worked fine. Either I still need to better understand K8S fundamentals or its really wierd! Anyways thanks for those who looked at my post.