codeflare_sdk.common.kubernetes_cluster package

Submodules

codeflare_sdk.common.kubernetes_cluster.auth module

The auth sub-module contains the definitions for the Authentication objects, which represent the methods by which a user can authenticate to their cluster(s). The abstract class, Authentication, contains two required methods login() and logout(). Users can use one of the existing concrete classes to authenticate to their cluster or add their own custom concrete classes here.

class codeflare_sdk.common.kubernetes_cluster.auth.Authentication[source]

Bases: object

An abstract class that defines the necessary methods for authenticating to a remote environment. Specifically, this class defines the need for a login() and a logout() function.

login()[source]

Method for logging in to a remote cluster.

logout()[source]

Method for logging out of the remote cluster.

class codeflare_sdk.common.kubernetes_cluster.auth.KubeConfigFileAuthentication(kube_config_path: str | None = None)[source]

Bases: KubeConfiguration

A class that defines the necessary methods for passing a user’s own Kubernetes config file. Specifically this class defines the load_kube_config() and config_check() functions.

load_kube_config()[source]

Function for loading a user’s own predefined Kubernetes config file.

class codeflare_sdk.common.kubernetes_cluster.auth.KubeConfiguration[source]

Bases: object

An abstract class that defines the method for loading a user defined config file using the load_kube_config() function

load_kube_config()[source]

Method for setting your Kubernetes configuration to a certain file

logout()[source]

Method for logging out of the remote cluster

class codeflare_sdk.common.kubernetes_cluster.auth.TokenAuthentication(token: str, server: str, skip_tls: bool = False, ca_cert_path: str | None = None)[source]

Bases: Authentication

TokenAuthentication is a subclass of Authentication. It can be used to authenticate to a Kubernetes cluster when the user has an API token and the API server address.

login() str[source]

This function is used to log in to a Kubernetes cluster using the user’s API token and API server address. Depending on the cluster, a user can choose to login in with –insecure-skip-tls-verify by setting skip_tls to True or –certificate-authority by setting skip_tls to False and providing a path to a ca bundle with ca_cert_path.

logout() str[source]

This function is used to logout of a Kubernetes cluster.

codeflare_sdk.common.kubernetes_cluster.auth.config_check() str[source]

Function for loading the config file at the default config location ~/.kube/config if the user has not specified their own config file or has logged in with their token and server.

codeflare_sdk.common.kubernetes_cluster.auth.get_api_client() ApiClient[source]

This function should load the api client with defaults

codeflare_sdk.common.kubernetes_cluster.kube_api_helpers module

This sub-module exists primarily to be used internally for any Kubernetes API error handling or wrapping.

Module contents