Crate kube_conf

Crate kube_conf 

Source
Expand description

Welcome to the kube-conf crate.

This crate is a convenient way of fetching the local user’s kubernetes config file and reading the values.

§Examples

§Fetching current context

use kube_conf::Config;
let config = Config::load("tests/config.yml")?;
let current_context = config.get_current_context().unwrap();

assert_eq!("dev-frontend", current_context.name);

§Fetching the default kubeconfig file

This typically means the file located at $HOME/.kube/config

use kube_conf::Config;
let config = Config::load_default()?;
let current_context = config.current_context.unwrap();

assert_eq!("dev-frontend", current_context);

Modules§

cluster
The module holding the Cluster struct
context
The module holding the Context struct
errors
A module that exposes errors thrown by the crate.
user
The module holding the User struct

Structs§

Config
The main struct that holds the entire config map. See the methods on this struct for ways to parse a config.