manics
June 27, 2022, 2:33pm
2
Hi! You haven’t given us much information on your setup, but I’m assuming you’re using Zero to JupyterHub with Kubernetes — Zero to JupyterHub with Kubernetes documentation ? Which version are you using? It would also be helpful if you showed us your configuration with secrets redacted.
psulowsk:
I guess that I need to set up the http_proxy, https_proxy and no_proxy environment variables with my proxy IP address to allow access to github but I don’t which pods I need to set these variables up for and how to do it properly. I tried to set it up manually for hub pod (via adding them to deployment file of this hub pod) but it does not work.
There’s a hub.extraEnv
property:
The JupyterHub Helm chart is configurable by values in your config.yaml. In this way, you can extend user resources, build off of different Docker images, manage security and authentication, and mo...
psulowsk:
Even after successful authorization, I don’t know how to set up the http_proxy, https_proxy and no_proxy variables for the pod with my jupyter server. If I don’t set them up, I don’t have the access to the internet from this pod:
You only want external http requests (to outside your network) to go through the proxy, presumably setting the environment variables at the pod level results in communication to the hub going through the proxy and failing to reach the hub. You could try setting no_proxy
Does setting no_proxy to include the hub ip work? On TLJH, that should be 127.0.0.1, I believe, so this config:
c.Spawner.environment = {
"http_proxy": "http://your proxy",
"https_proxy": "https://your proxy",
"no_proxy": "127.0.0.1,localhost",
}
ought to work, assuming the http client(s) in question supports $no_proxy. Which are they, btw?
If you still need to, kernelspecs can define an env dict to specify any environment variables that should be set when launching the kernel, for exam…
but if you’re using Z2JH the hub IP may change.
Alternatively you could try creating a custom kernelspec with environment variables:
Hi Jörg,
One approach that can be used is to extend your kernel specification’s configuration to include an env: element consisting of various environment variables that Notebook will include in the kernel’s environment. This element is added into the appropriate kernel.json file associated with the kernel. To locate the directory containing kernel.json issue the following command from a terminal:
jupyter kernelspec list
Locate the desired kernel in the left column to identify its specifica…