Registry / networking / kube
library3.1.0rscratesunverified

Kubernetes client and async controller runtime

# Cargo.toml [dependencies] kube = "3.1.0"
INSTALL
IMPORT
SIG · KUBE
K
kube
networkingrustv3.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
use kube::Client;

Lists all pods in the cluster using the default kubeconfig.

use kube::Client; use kube::api::ListParams; use kube::Api; use k8s_openapi::api::core::v1::Pod; #[tokio::main] async fn main() -> Result<(), kube::Error> { let client = Client::try_default().await?; let pods: Api<Pod> = Api::all(client); let list = pods.list(&ListParams::default()).await?; println!("Found {} pods", list.items.len()); Ok(()) }
Debug
Known issues
gotchaRequires an async runtime (tokio) and the 'kube' feature flags for specific functionality.
fix
Add tokio as dependency and enable features like 'client', 'runtime'.
affects: >=0.60.0
Upgrade
Version history
3.1.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
kube — cargo add kube · libregistry