From 2827e5fc8289882d53a0553ca1f737f9063cd360 Mon Sep 17 00:00:00 2001 From: Kirill Popov Date: Mon, 11 Nov 2024 13:35:43 +0300 Subject: [PATCH] documentation update on postStart hook use --- docs/source/jupyterhub/customizing/user-environment.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/source/jupyterhub/customizing/user-environment.md b/docs/source/jupyterhub/customizing/user-environment.md index 493dc958ef..03fbd010f1 100644 --- a/docs/source/jupyterhub/customizing/user-environment.md +++ b/docs/source/jupyterhub/customizing/user-environment.md @@ -331,6 +331,12 @@ container, meaning that commands that place files relative to `./` will result in users seeing those files in their home directory. You can use commands like `wget` to place files where you like. +It's also worth mentioning that Kubernetes PostStart hook is +[executed asynchronously](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-handler-execution). +This means there is no guarantee that the hook will execute before the container +ENTRYPOINT. This makes postStart hook unusable if some initialization must complete +before the user server start. For these cases a [custom command](#set-cmd) may be used. + A simple way to populate the notebook user's home directory is to add the required files to the container's `/tmp` directory and then copy them to `/home/jovyan` using a `postStart` hook. This example shows the use of