0

I have kubernetes 1.7.0 cluster that is running on Google Container Engine. I would like to connect to the cluster's kubernetes API using kubernetes client-python.

Is there any other way of configuring the ConfigurationObject in python client by using the credentials from .kube/config file.

I can access the kube proxy on local machine and access the cluster but I would like to connect it through python.

2
  • can you use kubectl from your local machine? Commented Jul 22, 2017 at 14:22
  • Yes I can use kubectl, like @Mehdy pointed it out it is an issues with api itself Commented Jul 23, 2017 at 20:43

1 Answer 1

1

Basically

from kubernetes import config 
config.load_kube_config() 

should work (except it won't because of the bug in GKE, read on). It tries to load config from default locations. Look at the parameters of that function for any customization.

For GKE, there is a bug and a PR to fix it and the fix should be available in 3.0.0b1.

Sign up to request clarification or add additional context in comments.

1 Comment

I have manually loaded the config file by copying it into the same directory my app lives in, for anyone who seems to have a temp solution

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.