initialize_kubernetes¶
- async safir.kubernetes.initialize_kubernetes()¶
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.
- Return type:
Notes
If
KUBERNETES_PORT
is set in the environment, this will useload_incluster_config
to get configuration information from the local pod metadata. Otherwise, it will useload_kube_config
to read configuration from the user’s home directory.