-
Notifications
You must be signed in to change notification settings - Fork 39
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
Support kube config #8
Conversation
a16478f
to
dd6ff55
Compare
4320ef7
to
9273cee
Compare
9273cee
to
072bb1d
Compare
Fixes #3 |
29e26b7
to
767db12
Compare
@mbohlool Could you check this? |
8a9582a
to
cbc6925
Compare
There was a problem hiding this 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
Andload_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).
kubernetes/lib/kubernetes/utils.rb
Outdated
# @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'], |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
@abstrctn Thanks for your reviewing!
I'm happy to hear that! Supporting auth-provider is necessary I think. |
cbc6925
to
7f0dce5
Compare
I will be happy to merge this when @abstrctn lgtm it. By my limited ruby knowledge it looks good. |
Thanks, LGTM! I'll open another issue for auth-provider support so we can frame next steps there. |
No description provided.