Struct kube_client::config::Kubeconfig
source · [−]pub struct Kubeconfig {
pub preferences: Option<Preferences>,
pub clusters: Vec<NamedCluster>,
pub auth_infos: Vec<NamedAuthInfo>,
pub contexts: Vec<NamedContext>,
pub current_context: Option<String>,
pub extensions: Option<Vec<NamedExtension>>,
pub kind: Option<String>,
pub api_version: Option<String>,
}
config
only.Expand description
Kubeconfig
represents information on how to connect to a remote Kubernetes cluster
Stored in ~/.kube/config
by default, but can be distributed across multiple paths in passed through KUBECONFIG
.
An analogue of the config type from client-go.
This type (and its children) are exposed primarily for convenience.
Config
is the intended developer interface to help create a Client
,
and this will handle the difference between in-cluster deployment and local development.
Fields
preferences: Option<Preferences>
General information to be use for cli interactions
clusters: Vec<NamedCluster>
Referencable names to cluster configs
auth_infos: Vec<NamedAuthInfo>
Referencable names to user configs
contexts: Vec<NamedContext>
Referencable names to context configs
current_context: Option<String>
The name of the context that you would like to use by default
extensions: Option<Vec<NamedExtension>>
Additional information for extenders so that reads and writes don’t clobber unknown fields.
kind: Option<String>
Legacy field from TypeMeta
api_version: Option<String>
Legacy field from TypeMeta
Implementations
sourceimpl Kubeconfig
impl Kubeconfig
Some helpers on the raw Config object are exposed for people needing to parse it
sourcepub fn read_from<P: AsRef<Path>>(path: P) -> Result<Kubeconfig, KubeconfigError>
pub fn read_from<P: AsRef<Path>>(path: P) -> Result<Kubeconfig, KubeconfigError>
Read a Config from an arbitrary location
sourcepub fn from_yaml(text: &str) -> Result<Kubeconfig, KubeconfigError>
pub fn from_yaml(text: &str) -> Result<Kubeconfig, KubeconfigError>
Read a Config from an arbitrary YAML string
This is preferable to using serde_yaml::from_str() because it will correctly
parse multi-document YAML text and merge them into a single Kubeconfig
sourcepub fn read() -> Result<Kubeconfig, KubeconfigError>
pub fn read() -> Result<Kubeconfig, KubeconfigError>
Read a Config from KUBECONFIG
or the the default location.
Trait Implementations
sourceimpl Clone for Kubeconfig
impl Clone for Kubeconfig
sourcefn clone(&self) -> Kubeconfig
fn clone(&self) -> Kubeconfig
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more