adamant-kite-43734
11/30/2022, 11:52 AMwitty-engineer-12406
11/30/2022, 11:56 AMwitty-engineer-12406
11/30/2022, 12:05 PMimport os
from kubernetes import client, config
KUBE_CONFIG_FILE = ""
if os.path.isfile(KUBE_CONFIG_FILE):
config.load_kube_config(KUBE_CONFIG_FILE)
# check if serviceaccount exits
elif os.path.exists("/run/secrets/kubernetes.io/serviceaccount"):
print("startup: try loading service account")
config.load_incluster_config()
else:
raise Exception("FAIL: cannot connect to control plain")
result = client.ApiClient().call_api(resource_path="/healthz",
method="GET",
# query_params={"verbose": "true"},
response_type=str)
witty-engineer-12406
11/30/2022, 12:15 PMwitty-engineer-12406
11/30/2022, 2:10 PMwitty-engineer-12406
11/30/2022, 2:11 PM/healthz
not work 🤔