fix(ai): query ai namespace instead of serviceaccount namespace
This commit is contained in:
parent
dfe409c475
commit
059f4cd291
@ -216,10 +216,8 @@ def _discover_ai_meta() -> dict[str, str]:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
token = token_path.read_text().strip()
|
token = token_path.read_text().strip()
|
||||||
namespace = ns_path.read_text().strip() or AI_K8S_NAMESPACE
|
namespace = AI_K8S_NAMESPACE
|
||||||
api_server = os.getenv("KUBERNETES_SERVICE_HOST", "kubernetes.default.svc")
|
base_url = "https://kubernetes.default.svc"
|
||||||
api_port = os.getenv("KUBERNETES_SERVICE_PORT", "443")
|
|
||||||
base_url = f"https://{api_server}:{api_port}"
|
|
||||||
pod_url = f"{base_url}/api/v1/namespaces/{namespace}/pods?labelSelector={AI_K8S_LABEL}"
|
pod_url = f"{base_url}/api/v1/namespaces/{namespace}/pods?labelSelector={AI_K8S_LABEL}"
|
||||||
|
|
||||||
with httpx.Client(verify=str(ca_path), timeout=HTTP_CHECK_TIMEOUT_SEC, headers={"Authorization": f"Bearer {token}"}) as client:
|
with httpx.Client(verify=str(ca_path), timeout=HTTP_CHECK_TIMEOUT_SEC, headers={"Authorization": f"Bearer {token}"}) as client:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user