Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up the home directory in Kubernetes #460

Open
danielhollas opened this issue May 23, 2024 · 1 comment
Open

Setting up the home directory in Kubernetes #460

danielhollas opened this issue May 23, 2024 · 1 comment

Comments

@danielhollas
Copy link
Contributor

Just as a followup to my question about how kubernetes mounts volume, indeed it doesn't seem possible to use overlay mount to preserve pre-existing files in the /home/jovyan directory in the image. I found this StackOverflow answer interesting. https://stackoverflow.com/a/63128564/3682277

A common solution for your use-case is, to use an init container to set up the emptyDir, before the main container is started. So basically you specify the emptyDir as a volume mount in both the init container and the main container and have the init container copy the files into the emptyDir.

Might be interesting to explore, in case you haven't already CC @unkcpz @superstar54

In any case, whatever solution you arrive at at the end, we should document it somewhere in this repo.

@unkcpz
Copy link
Member

unkcpz commented Jun 4, 2024

Exactly, I did mentioned it to @superstar54 and it actually documented in jupyter k8s deployment, in https://z2jh.jupyter.org/en/latest/jupyterhub/customizing/user-environment.html#about-user-storage-and-adding-files-to-it

singleuser:
  lifecycleHooks:
    postStart:
      exec:
        command: ["cp", "-a", "src", "target"]

Therefore if we only considered the use case of speed up k8s startup, we don't need the move and uncompress script in before-notebook.d/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants