kontena / k8s-client

Ruby Kubernetes API client
Apache License 2.0
76 stars 26 forks source link

Add support for HTTP Basic authentication #113

Closed nielsslot closed 5 years ago

nielsslot commented 5 years ago

I tried using k8s-client with a kubeconfig that uses username and password for authentication and noticed it didn't work. K8s::Config already had support for reading the relevant fields from the YAML, but K8s::Transport ignored them.

This change makes K8s::Transport use the username and password if available. The username and password are passed as an HTTP Authorization Basic header to the Kubernetes API server. I can now use k8s-client to query the Kubernetes server using the kubeconfig with username and password.

jakolehm commented 5 years ago

@kke PTAL