kubelet 0.2.0

A Kubernetes kubelet implementation in Rust
docs.rs failed to build kubelet-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: kubelet-1.0.0-alpha.1

A crate for building custom Kubernetes kubelets.

The crate provides the [Provider] trait for declaring a Kubelet backend as well as a the [Kubelet] type which takes a [Provider] and runs a Kubelet server.

Example

use kubelet::{Provider, Pod, Kubelet, config::Config};

// Create some type that will act as your provider
struct MyProvider;

// Implement the `Provider` trait for that type
#[async_trait::async_trait]
impl Provider for MyProvider {
const ARCH: &'static str = "my-arch";

async fn add(&self, pod: Pod) -> anyhow::Result<()> {
todo!("Implement Provider::add")
}

// Implement the rest of the methods
# async fn modify(&self, pod: Pod) -> anyhow::Result<()> { todo!() }
# async fn delete(&self, pod: Pod) -> anyhow::Result<()> { todo!() }
# async fn logs(&self, namespace: String, pod: String, container: String, sender: kubelet::LogSender) -> anyhow::Result<()> { todo!() }
}

async {
// Instantiate your provider type
let provider = MyProvider;

// Load a kubernetes configuration
let kubeconfig = kube::Config::infer().await.unwrap();
// Get a configuration for the Kubelet
let kubelet_config = Config::default();

// Instantiate the Kubelet
let kubelet = Kubelet::new(provider, kubeconfig, kubelet_config);
// Start the Kubelet and block on it
kubelet.start().await.unwrap();
};