kube
Rust client for Kubernetes API forking ynqa/kubernetes-rust.
This version has more error handling and a Reflector
for easy caching of CRD state. It aims to cater to the more common operator case, but allows you sticking in dependencies like k8s-openapi.
Example
See operator-rs for ideas.
Main ideas, depending on how complicated your need is:
Watch calls on a resource
You probably want a reflector? See operator-rs.
Basic calls
Use the exposed APIClient
herein, and write Request functions directly:
Then call them with:
let res = client.?;
where Resource
+ ResourceList
can be constructed analogously to what's in ./src/api.
You can also look at the documentation for k8s-openapi is generating. The functions that return http::Request
are compatible.
Many basic calls
Pull in k8s-openapi and call it from the client herein. Note that not everything is available from k8s-openapi anyway. Watching Crd entries (not the core definitions) was missing in 0.4.0.