Struct roperator::config::ClientConfig [−][src]
pub struct ClientConfig { pub api_server_endpoint: String, pub credentials: Credentials, pub ca_data: Option<CAData>, pub user_agent: String, pub verify_ssl_certs: bool, pub impersonate: Option<String>, pub impersonate_groups: Vec<String>, }
Configuration for how to connect to the Kubernetes API server and authenticate. This configuration can typically be created from either a service account or a kubeconfig file using one of the provided functions, but you may also create configurations manually.
Fields
api_server_endpoint: String
The http(s) endpoint of the api server, including the scheme and port
credentials: Credentials
The credentials for authenticating with the api server
ca_data: Option<CAData>
user_agent: String
The user-agent string to include in requests to the api server. This typically doesn’t affect the fuctioning of the operator, but it can be useful when looking through api server logs
verify_ssl_certs: bool
Escape hatch for turning off ssl certificate validation in test environments only. Don’t
set to true
in production. Don’t be that person.
impersonate: Option<String>
Optional user to impersonate
impersonate_groups: Vec<String>
optional list of groups to add when impersonating a user. Ignored if impersonate
is empty.
Implementations
impl ClientConfig
[src]
pub fn from_service_account(
user_agent: impl Into<String>
) -> Result<ClientConfig, Error>
[src]
user_agent: impl Into<String>
) -> Result<ClientConfig, Error>
Attempts to build a ClientConfig
from a service account that’s been mounted in the usual path
(SERVICE_ACCOUNT_TOKEN_PATH
). Returns an error if either the “token” or “ca.crt” files are
missing.
The returned ClientConfig
will use the default api_server_endpoint
of "kubernetes.default.svc"
,
so you’ll need to change that if your cluster uses something different.
The user_agent
is typically the same value as the operator_name
from the OperatorConfig
.
pub fn from_kubeconfig(
user_agent: impl Into<String>
) -> Result<ClientConfig, KubeConfigError>
[src]
user_agent: impl Into<String>
) -> Result<ClientConfig, KubeConfigError>
Attempts to build a ClientConfig
from a kubeconfig file. This respects the value of the KUBECONFIG
environment variable. Most, but not all, of the authentication methods are supported, including
certificates, username/password, token, and exec. Roperator does not currently support rotation of
credentials, so any credentials taken from the kubeconfig will need to be valid for the lifetime of
the application.
Trait Implementations
impl Clone for ClientConfig
[src]
fn clone(&self) -> ClientConfig
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ClientConfig
[src]
impl PartialEq<ClientConfig> for ClientConfig
[src]
fn eq(&self, other: &ClientConfig) -> bool
[src]
fn ne(&self, other: &ClientConfig) -> bool
[src]
impl StructuralPartialEq for ClientConfig
[src]
Auto Trait Implementations
impl RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl UnwindSafe for ClientConfig
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,