What does running:
```
import os
os.path.expanduser('~/.kube/config')
```
give you from inside Jupyter? That's similar to what load_kube_config
is using, and if that doesn't work load_kube_config won't either...
Can you also try explicitly specifying the path to kube/config - like
`config.load_kube_config('full-path-to-kube-.config-file')`?
Also am curious, what're you doing with the kubernetes API in a
Jupyter notebook? I do a lot of work around Kubernetes + Jupyter so
curious :)
On Sat, May 13, 2017 at 9:05 PM, Michael Bright <[email protected]> wrote:
>
> Here's a question I asked just now in the kubernetes-sig-apps group, but as
> it's Jupyter related, maybe someone here has an idea ...
>
>
> 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
> 192.168.99.100:8443 when run from the command-line
> 127.0.0.1:8080 when run from Jupyter
>
> 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?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/49c03670-104b-495e-9ae6-7198d75ff32d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
Yuvi Panda T
http://yuvi.in/blog
--
You received this message because you are subscribed to the Google Groups
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jupyter/CAFw%3DyShgCODc%2B0DEy8Gfiq5dCPFrZwHCaw8ySyr5nGTK%2BGwhcg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.