Closed chrisroat closed 4 years ago
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:
Hi @chrisroat,
c.KubeSpawner.lifecycle_hooks
in a python configuration file such as from hub.extraConfig, or by using the Helm chart configuration singleuser.lifecycleHooks
. Whatever you set this to, should match the k8s official specification, which you can google to find a reference about. I think you will find examples in the z2jh.jupyter.org documentation somewhere as well.I'm not sure what makes the most sense or what would work well, but I'd try the postStart lifecycleHook first.
Hi there @chrisroat :wave:!
I closed this issue because it was labelled as a support question.
Please help us organize discussion by posting this on the http://discourse.jupyter.org/ forum.
Our goal is to sustain a positive experience for both users and developers. We use GitHub issues for specific discussions related to changing a repository's content, and let the forum be where we can more generally help and inspire each other.
Thanks you for being an active member of our community! :heart:
This issue has been mentioned on Jupyter Community Forum. There might be relevant details there:
https://discourse.jupyter.org/t/gcloud-service-account-activation-on-zero-to-jupyterhub/4816/2
@consideRatio Thanks for the tip. For the record, in order to pick up the environmental var, I needed
lifecycleHooks:
postStart:
exec:
command:
- 'sh'
- '-c'
- "gcloud auth activate-service-account --key-file=${GOOGLE_APPLICATION_CREDENTIALS}"
I have jupyterhub running on K8s, which has a service account json key file loaded from a K8s secret. The env var GOOGLE_APPLICATION_CREDENTIALS is set to point to the file.
I find that in order for gsutil to work properly (via
subprocess.run
), I have to execute the following command:What is the proper config/hook to setup in order that this is done automatically for a singleuser?
Thanks!