Kubecfg is an interface for reading and representing kubernetes config files in rustlang. Kubernetes configuration files store information needed to authenticate across clusters. This is essential information if you wish to communicate with the kubernetes REST api.
Typically interaction with kubectl
will result in a config file persisted to disk at a standard location on disk. To read that configuration information use from_std_path()
extern crate kubecfg;
use kubecfg::Config;
fn main() {
if let Ok(cfg) = Config::from_std_path() {
println!("current context is {}", cfg.current_context)
}
}
Doug Tangren (softprops) 2016