Rust client for Kubernetes
Clone or download
Latest commit e5aee78 Jan 19, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Remove unused dependencies Jan 16, 2019
src Minor spelling fixes Jan 19, 2019
.gitignore Minor spelling fixes Jan 19, 2019
.travis.yml Add travis ci Oct 19, 2018
Cargo.toml Remove unused dependencies Jan 16, 2019
LICENSE Init commit Oct 11, 2018
README.md Add travis ci Oct 19, 2018

README.md

kubernetes-rust

Build Status Client Capabilities Client Support Level

Rust client for Kubernetes API.

Example

List all Pods on kube-system:

extern crate failure;
extern crate k8s_openapi;
extern crate kubernetes;

use k8s_openapi::v1_10::api::core::v1;
use kubernetes::client::APIClient;
use kubernetes::config;

fn main() {
    let kubeconfig = config::load_kube_config().expect("failed to load kubeconfig");
    let kubeclient = APIClient::new(kubeconfig);
    let req = v1::Pod::list_core_v1_namespaced_pod(
        "kube-system",
        None,
        None,
        None,
        None,
        None,
        None,
        None,
        None,
        None,
    ).expect("failed to define list pod");
    let list_pod = kubeclient
        .request::<v1::PodList>(req)
        .expect("failed to list up pods");
    println!("{:?}", list_pod);
}