kubecfg
Python library and cli utility to check k8s client configurations
Install
pip install kubecfg
Run
kubecfg
Use the library
This example shows how to use the HTTPX to obtain the version of the API server.
import httpx
from kubecfg.config import KubeConfig
k8s_config = KubeConfig()
k8s_config.load_config()
server, cert, client_ca = k8s_config.get_auth_data()
r = httpx.get(f"{server}/version", cert=cert, verify=client_ca)
r.raise_for_status()
print(r.text)