-
Notifications
You must be signed in to change notification settings - Fork 4
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
[wip] native Kubernetes client #29
base: master
Are you sure you want to change the base?
Conversation
This adds a WIP implementation of a lightweight Kubernetes client, or in other words, a kubeconfig parser with some integration with reqwest to configure auth. It only needs serde_yaml and reqwest. Ideally this should end up being much smaller than a 'proper' client and can easily support the few functions we actually care about (auth, proxies, streamed responses, websockets, exotic kubeconfig formats, ...). This at least properly parses all the kubeconfigs I have handy, including minikube, microk8s, eks, kubeadm, and a few others.
- bumps reqwest version for proxy support - mostly implements KubernetesClient::new() - adds notes about all the tls libs being broken :/ Signed-off-by: Tim Buckley <[email protected]>
I can at least auth against DigitalOcean now (uses embedded client + CA certs). Minikube and some kubeadm clusters are broken since rustls doesn't support IP address hosts (rustls/hyper-rustls#56 (comment)). Also, native-tls (via reqwest, at least) doesn't support PEM certificates so we're stuck with rustls. Should look into whether or not |
Also, still need some in-cluster auth support... |
More TLS issues...
This is all to say, there is probably a path forward with native-tls, however it:
I think rustls + the |
- separate enum structs - fully implement exec auth - honor insecure-skip-tls-verify - implement reauthentication and expiry checks for exec auth - split `KubernetesClient::new()` and `KubernetesClient::from_context()`
7308e4c
to
c894d39
Compare
Additional ssl-related complications if we want websocket support:
So the only way forward if we want websockets looks like:
Frankly, I'm tempted to sit on this a while and see if the library situation improves. |
Not a ton of movement over the last 8 months, unfortunately:
|
This adds a native Kubernetes client to replace the kubectl proxy subprocess. That is, a kubeconfig parser with some integration with reqwest to configure proxies and auth, or the rust equivalent of tiny-kubernetes. It only strictly needs serde_yaml, reqwest, and base64.
Ideally this should end up being much smaller than a 'proper' client and can easily support the few functions we actually care about (auth, proxies, streamed responses, websockets, exotic kubeconfig formats, ...).
This at least properly parses all the kubeconfigs I have handy, including minikube, microk8s, eks, kubeadm, and a few others.
Closes #28