libcloud.common.kubernetes module

Module which contains common Kubernetes related code.

class libcloud.common.kubernetes.KubernetesBasicAuthConnection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, backoff=None, retry_delay=None)[source]

Bases: ConnectionUserAndKey

Initialize user_id and key; set secure to an int based on passed value.

add_default_headers(headers)[source]

Add parameters that are necessary for every request If user and password are specified, include a base http auth header

responseCls

alias of KubernetesResponse

timeout: int | float | None = 60
class libcloud.common.kubernetes.KubernetesDriverMixin(key=None, secret=None, secure=False, host='localhost', port=4243, key_file=None, cert_file=None, ca_cert=None, ex_token_bearer_auth=False)[source]

Bases: object

Base driver class to be used with various Kubernetes drivers.

NOTE: This base class can be used in different APIs such as container and compute one.

Parameters:
  • key (str) – API key or username to be used (required)

  • secret (str) – Secret password to be used (required)

  • secure (bool) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.

  • host (str) – Override hostname used for connections.

  • port (int) – Override port used for connections.

  • key_file (str) – Path to the key file used to authenticate (when using key file auth).

  • cert_file (str) – Path to the cert file used to authenticate (when using key file auth).

  • ex_token_bearer_auth (bool) – True to use token bearer auth.

Returns:

None

exception libcloud.common.kubernetes.KubernetesException(code, message)[source]

Bases: Exception

class libcloud.common.kubernetes.KubernetesTLSAuthConnection(key, secure=True, host='localhost', port='6443', key_file=None, cert_file=None, **kwargs)[source]

Bases: KeyCertificateConnection

Initialize cert_file; set secure to an int based on passed value.

add_default_headers(headers)[source]

Adds default headers (such as Authorization, X-Foo-Bar) to the passed headers

Should return a dictionary.

responseCls

alias of KubernetesResponse

timeout: int | float | None = 60
class libcloud.common.kubernetes.KubernetesTokenAuthConnection(key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, backoff=None, retry_delay=None)[source]

Bases: ConnectionKey

Initialize user_id and key; set secure to an int based on passed value.

add_default_headers(headers)[source]

Adds default headers (such as Authorization, X-Foo-Bar) to the passed headers

Should return a dictionary.

responseCls

alias of KubernetesResponse

timeout: int | float | None = 60