prefect_kubernetes.credentials
Module for defining Kubernetes credential handling and client generation.
Classes
KubernetesClusterConfig
Stores configuration for interaction with Kubernetes clusters.
See from_file for creation.
Attributes:
config: The entire loaded YAML contents of a kubectl config filecontext_name: The name of the kubectl context to use
configure_client
from_file
get_api_client
parse_yaml_config
KubernetesCredentials
Credentials block for generating configured Kubernetes API clients.
Attributes:
cluster_config: AKubernetesClusterConfigblock holding a JSON kube config for a specific kubernetes context.
get_client
client_type: The resource-specific type of Kubernetes client to retrieve.
get_resource_specific_client
-
It will first attempt to use a
KubernetesCredentialsblock’scluster_configto configure a client usingKubernetesClusterConfig.configure_client. - Attempt in-cluster connection (will only work when running on a pod).
- Attempt out-of-cluster connection using the default location for a kube config file.
client_type: The Kubernetes API client type for interacting with specific Kubernetes resources.
- An authenticated, resource-specific Kubernetes Client.
ValueError: Ifclient_typeis not a valid Kubernetes API client type.