initialize_kubernetes

async safir.kubernetes.initialize_kubernetes() None

Load the Kubernetes configuration.

This has to be run once per process and should be run during application startup. This function handles Kubernetes configuration independent of any given Kubernetes client so that clients can be created for each request.

Notes

If KUBERNETES_PORT is set in the environment, this will use load_incluster_config to get configuration information from the local pod metadata. Otherwise, it will use load_kube_config to read configuration from the user’s home directory.