I tried using kubernetes-incubator/client-python from within Jupyter.and was unable to get a *very* simple example working.
I'm running kubernetes (client-python v 2.0.0), Minikube v0.19, Anaconda Python 4.3.17, Python 3.6.1, Jupyter notebook 5.0.
When I run the following example from the command-line, it works fine:(yes it's using the same version of Anaconda Python)
from kubernetes import client, config
config.load_kube_config()
v1 = client.CoreV1Api()
print(v1.list_namespace())
When I run the example from within Jupyter I get connection refused.
It seems that v1.api_client.host is set to
After several hours of playing with this I now have a workaround which is to run
kubectl proxy --port=8080
in another terminal.
I'd really like to avoid that workaround so that my notebook is self contained.
As far as I can tell my shell ernvironment is identical between Jupyter and the command-line.
Any idea what I need to do to fix this?