Skip to content
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

Proper Kubernetes reader #28

Open
5 of 8 tasks
timothyb89 opened this issue Jul 18, 2019 · 1 comment · May be fixed by #29
Open
5 of 8 tasks

Proper Kubernetes reader #28

timothyb89 opened this issue Jul 18, 2019 · 1 comment · May be fixed by #29

Comments

@timothyb89
Copy link
Contributor

timothyb89 commented Jul 18, 2019

The current Kubernetes reader is pretty hacky and runs kubectl proxy as a subprocess to avoid needing to deal with API authentication and system proxies.

This adds complexity and potentially leaves behind zombie kubectl proxy processes when killed, despite best effort attempts to clean them up. Additionally, due to security restrictions in kubectl, we can't use websockets to watch for namespace events.

Instead, we should use the Kubernetes API directly. This involves:

  • discovering and parsing kubeconfig files (they do not appear to have a documented spec) and support various auth mechanisms
    • client cert auth, embedded or file
    • username/password auth
    • exec auth (e.g. aws-iam-authenticator)
    • server certs, embedded or file
    • null auth
  • functions for each auth method to add auth headers to a request
  • replace existing kubectl proxy implementation
@timothyb89 timothyb89 linked a pull request Jul 19, 2019 that will close this issue
@timothyb89
Copy link
Contributor Author

Started in #29, but blocked on SSL issues.

The native client implementation supports all auth types I'm aware of and should theoretically work with any given kubeconfig... except for servers without a proper hostname (minikube, microk8s, etc). rustls can't verify IP addresses, so we'll probably need to pull in the kubectl proxy hack so these cases still work. At least now it's usually avoidable.

I'd also like to spin the Kubernetes client out into its own crate at some point.

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 a pull request may close this issue.

1 participant