Skip to content

Support kube config #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 10, 2018

Conversation

yuanying
Copy link
Contributor

No description provided.

@yuanying yuanying changed the title Support kube config [WIP] Support kube config Dec 21, 2017
@yuanying yuanying force-pushed the support-kube-config branch 3 times, most recently from a16478f to dd6ff55 Compare December 25, 2017 06:42
@yuanying yuanying changed the title [WIP] Support kube config Support kube config Dec 25, 2017
@yuanying yuanying force-pushed the support-kube-config branch 2 times, most recently from 4320ef7 to 9273cee Compare December 26, 2017 00:23
@yuanying yuanying force-pushed the support-kube-config branch from 9273cee to 072bb1d Compare December 26, 2017 05:58
@yuanying
Copy link
Contributor Author

Fixes #3

@yuanying yuanying force-pushed the support-kube-config branch 2 times, most recently from 29e26b7 to 767db12 Compare December 26, 2017 07:02
@yuanying
Copy link
Contributor Author

@mbohlool Could you check this?

@yuanying yuanying force-pushed the support-kube-config branch 2 times, most recently from 8a9582a to cbc6925 Compare December 26, 2017 07:35
Copy link

@abstrctn abstrctn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested load_kube_config locally against:

  • minikube with client cert / key
  • GKE with client cert / key + username / password
    And load_incluster_config within a GKE cluster, and both worked great!

It would be great to add support for the user's auth-provider config attribute in a later update to support the credentials added by default when connecting to GKE clusters (I'd be happy to make a PR).

# @param context [String] Set the active context. If is set to nil, current_context from config file will be used.
# @param client_configuration [Kubernetes::Configuration] The Kubernetes::Configuration tp set configs to.
def load_kube_config(
config_file=ENV['KUBE_CONFIG'],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and line 54 should be config_file=ENV['KUBECONFIG'] (without the underscore) to match the variable name used by kubectl: https://github.com/kubernetes-client/python-base/blob/a41c44715241552de73361673152f3f0d0bb9bc4/config/kube_config.py#L32

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@yuanying
Copy link
Contributor Author

yuanying commented Jan 9, 2018

@abstrctn Thanks for your reviewing!

It would be great to add support for the user's auth-provider config attribute in a later update to support the credentials added by default when connecting to GKE clusters (I'd be happy to make a PR).

I'm happy to hear that! Supporting auth-provider is necessary I think.

@yuanying yuanying force-pushed the support-kube-config branch from cbc6925 to 7f0dce5 Compare January 10, 2018 00:30
@mbohlool mbohlool assigned mbohlool and unassigned mbohlool Jan 10, 2018
@mbohlool
Copy link
Contributor

mbohlool commented Jan 10, 2018

I will be happy to merge this when @abstrctn lgtm it. By my limited ruby knowledge it looks good.

@abstrctn
Copy link

Thanks, LGTM! I'll open another issue for auth-provider support so we can frame next steps there.

@mbohlool mbohlool merged commit 7f26817 into kubernetes-client:master Jan 10, 2018
@mbohlool mbohlool mentioned this pull request Jan 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants