jupyter-server / enterprise_gateway

A lightweight, multi-tenant, scalable and secure gateway that enables Jupyter Notebooks to share resources across distributed clusters such as Apache Spark, Kubernetes and others.
https://jupyter-enterprise-gateway.readthedocs.io/en/latest/
Other
617 stars 222 forks source link

Flow configured envs from client to kernel pod #1164

Closed kevin-bates closed 1 year ago

kevin-bates commented 1 year ago

While looking into #1160, it became apparent that the flow of env variables from the client to the kernel pods is not working for KubernetesProcessProxy. Only a fixed set of KERNEL_-prefixed variables were transferred to the pod, along with system-defined values for the kernel launcher parameters. This pull request ensures that envs configured to flow to the kernel pod do flow.

Previously, because k8s relies on its own envs, we unconditionally included all EG-configured envs as well, even though those also never found their way into the kernel pod. This PR only copies EG envs prefixed with KUBECONFIG or KUBERNETES_SERVICE rather than the entire EG environment.

kevin-bates commented 1 year ago

@lresende, @rahul26goyal - could I please get a review from either of you?

@blair-anson - if you'd like to provide a review (or anyone else) - that would be much appreciated!

Thank you.

kevin-bates commented 1 year ago

Going ahead with the merge - thank you for your review @kiersten-stokes.