#config-file #kubernetes #kube #yaml

kube-conf

Easily fetch the user's local Kubernetes config file

2 unstable releases

0.2.0 Jun 7, 2019
0.1.0 Apr 27, 2019

#836 in Configuration

Download history 12/week @ 2024-02-21 18/week @ 2024-02-28 12/week @ 2024-03-06 6/week @ 2024-03-13 3/week @ 2024-03-20 18/week @ 2024-03-27 30/week @ 2024-04-03

51 downloads per month

MIT license

19KB
226 lines

kube-conf

Crates.io Build Status

Easily fetch the local Kubernetes config file

Documentation


lib.rs:

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);

Dependencies

~4.5–6.5MB
~128K SLoC