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
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Kubeconfig
impl Debug for Kubeconfig
sourceimpl Default for Kubeconfig
impl Default for Kubeconfig
sourcefn default() -> Kubeconfig
fn default() -> Kubeconfig
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for Kubeconfig
impl<'de> Deserialize<'de> for Kubeconfig
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for Kubeconfig
impl Serialize for Kubeconfig
Auto Trait Implementations
impl RefUnwindSafe for Kubeconfig
impl Send for Kubeconfig
impl Sync for Kubeconfig
impl Unpin for Kubeconfig
impl UnwindSafe for Kubeconfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more