kubex.configuration¶
Auto-generated reference for the kubex.configuration module.
ClientConfiguration model¶
kubex.configuration.configuration ¶
AuthInfo ¶
Bases: BaseK8sModel
AuthInfo contains information that describes identity information. This is use to tell the kubernetes cluster who you are.
as_
class-attribute
instance-attribute
¶
Impersonate is the username to impersonate. The name matches the flag.
as_groups
class-attribute
instance-attribute
¶
ImpersonateGroups is the groups to impersonate.
as_uid
class-attribute
instance-attribute
¶
ImpersonateUID is the uid to impersonate.
as_user_extra
class-attribute
instance-attribute
¶
ImpersonateUserExtra contains additional information for impersonated user.
auth_provider
class-attribute
instance-attribute
¶
AuthProvider specifies a custom authentication plugin for the kubernetes cluster.
client_certificate
class-attribute
instance-attribute
¶
ClientCertificate is the path to a client cert file for TLS.
client_certificate_data
class-attribute
instance-attribute
¶
ClientCertificateData contains PEM-encoded data from a client cert file for TLS. Overrides ClientCertificate.
client_key
class-attribute
instance-attribute
¶
ClientKey is the path to a client key file for TLS.
client_key_data
class-attribute
instance-attribute
¶
ClientKeyData contains PEM-encoded data from a client key file for TLS. Overrides ClientKey.
token
class-attribute
instance-attribute
¶
Token is the bearer token for authentication to the kubernetes cluster.
token_file
class-attribute
instance-attribute
¶
TokenFile is the path to a file containing the bearer token for authentication to the kubernetes cluster.
AuthProviderConfig ¶
Cluster ¶
Bases: BaseK8sModel
Cluster contains information about how to communicate with a kubernetes cluster.
certificate_authority
class-attribute
instance-attribute
¶
CertificateAuthority is the path to a cert file for the certificate authority.
certificate_authority_data
class-attribute
instance-attribute
¶
CertificateAuthorityData contains PEM-encoded certificate authority certificates. Overrides CertificateAuthority.
disable_compression
class-attribute
instance-attribute
¶
DisableCompression allows client to opt-out of response compression for all requests to the server. This is useful to speed up requests (specifically lists) when client-server network bandwidth is ample, by saving time on compression (server-side) and decompression (client-side): https://github.com/kubernetes/kubernetes/issues/112296.
extensions
class-attribute
instance-attribute
¶
Extensions holds additional information. This is useful for extenders so that reads and writes don't clobber unknown fields.
insecure_skip_tls_verify
class-attribute
instance-attribute
¶
InsecureSkipTLSVerify skips the validity check for the server's certificate. This will make your HTTPS connections insecure.
proxy_url
class-attribute
instance-attribute
¶
ProxyURL is the URL to the proxy to be used for all requests made by this client. URLs with "http", "https", and "socks5" schemes are supported. If this configuration is not provided or the empty string, the client attempts to construct a proxy configuration from http_proxy and https_proxy environment variables. If these environment variables are not set, the client does not attempt to proxy requests. socks5 proxying does not currently support spdy streaming endpoints (exec, attach, port forward).
server
instance-attribute
¶
Server is the address of the kubernetes cluster (https://hostname:port).
tls_server_name
class-attribute
instance-attribute
¶
TLSServerName is used to check server certificate. If TLSServerName is empty, the hostname used to contact the server is used.
Context ¶
Bases: BaseK8sModel
Context holds user values, cluster values, and extension values.
ExecConfig ¶
Bases: BaseK8sModel
ExecConfig specifies a command to provide client credentials.
api_version
class-attribute
instance-attribute
¶
api_version: (
Literal[
"client.authentication.k8s.io/v1beta1",
"client.authentication.k8s.io/v1",
]
| None
) = Field(None, alias="apiVersion")
APIVersion is the version of the API.
args
class-attribute
instance-attribute
¶
Args to pass to the command when executing it.
env
class-attribute
instance-attribute
¶
Env defines the environment variables to pass to the command.
ExecInteractiveMode ¶
Bases: str, Enum
ExecInteractiveMode define the interactity of the child process
KubeConfig ¶
Bases: BaseK8sModel
Config holds the information needed to build connect to remote kubernetes clusters as a given user.
clusters
class-attribute
instance-attribute
¶
Clusters is a map of referencable names to cluster configs.
contexts
class-attribute
instance-attribute
¶
Contexts is a map of referencable names to context configs.
current_context
class-attribute
instance-attribute
¶
CurrentContext is the name of the context that you would like to use by default.
users
class-attribute
instance-attribute
¶
AuthInfos is a map of referencable names to user configs.
NamedAuthInfo ¶
NamedClaster ¶
NamedContext ¶
NamedExtension ¶
OIDCConfig ¶
Bases: BaseK8sModel
client_id
class-attribute
instance-attribute
¶
ClientID is the client ID for the OpenID Connect client, as described in https://tools.ietf.org/html/rfc6749#section-2.2.
client_secret
class-attribute
instance-attribute
¶
ClientSecret is the client secret for the OpenID Connect client, as described in https://tools.ietf.org/html/rfc6749#section-2.3.
idp_issuer_url
class-attribute
instance-attribute
¶
IDPIssuerURL is the URL of the OpenID issuer, only HTTPS scheme will be accepted.
refresh_token
class-attribute
instance-attribute
¶
RefreshToken is the refresh token for the OpenID Connect client, as described in https://tools.ietf.org/html/rfc6749#section-6.
RawExtension ¶
Bases: BaseK8sModel
RawExtension is used to hold extensions in external versions
Kubeconfig file loading¶
kubex.configuration.file_config ¶
configure_from_kubeconfig
async
¶
configure_from_kubeconfig(
config: KubeConfig | None = None,
use_context: str | None = None,
) -> ClientConfiguration
Creates a ClientConfiguration from a KubeConfig.