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_PORTis set in the environment, this will useload_incluster_configto get configuration information from the local pod metadata. Otherwise, it will useload_kube_configto read configuration from the user’s home directory.