jupyterhub / zero-to-jupyterhub-k8s

Helm Chart & Documentation for deploying JupyterHub on Kubernetes
https://zero-to-jupyterhub.readthedocs.io
Other
1.55k stars 797 forks source link

Poststart hook not executed #1606

Closed romanzac closed 4 years ago

romanzac commented 4 years ago

Hi All,

Describe the bug

I have configured profile and related poststart hook. It is a simple copy from /tmp directory into user's home.

singleuser:
  storage:
    dynamic:
      storageClass: gfs
  image:
    name: registry:8443/q/bio-jupyter-k8s
    tag: test
    pullPolicy: IfNotPresent
  #fsGid: 100
  profileList:
    - display_name: "Bio Environment"
      description: "Sample Jupyter notebook."
      default: true
      lifecycle_hooks:
        postStart:
          exec:
            command:
              - "sh"
              - "-c"
              - >
                cp -r -u /tmp/bio-python /home/jovyan;

To Reproduce Login as LDAP user, select profile and start it.

Expected behavior bio-python folder copied to /home/jovyan

Compute Information

consideRatio commented 4 years ago

What events are associated with the pod about the poststarthook? I think if the hook fails to execute, it will fail to start the pod entirely. So, did it register to run at all?

kubectl describe pod -n jhub jupyter-username-here

I suggest you start debugging if this can make a empty file show up named post-hook-ran-ok in your home folder.

            command:
              - "sh"
              - "-c"
              - "touch /home/jovyan/post-hook-ran-ok"
romanzac commented 4 years ago

It was not registered... I forgot to use "kubespawner_override:"

Many thanks. R.