android-emulator: gate reaches the kube API via env vars, not DNS
First real wake attempt 500'd: kubernetes.default.svc does not resolve from the gate's alpine pod (musl + injected dns_config ndots quirk), so every kube call failed with 'Name does not resolve'. Use the injected KUBERNETES_SERVICE_HOST/PORT env vars — the canonical in-cluster endpoint, no DNS dependency. ConfigMap checksum annotation rolls the gate automatically.
This commit is contained in:
parent
b1b9de90e4
commit
16adda2c48
1 changed files with 6 additions and 1 deletions
|
|
@ -14,7 +14,12 @@ from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
|||
|
||||
NS = os.environ.get("NAMESPACE", "android-emulator")
|
||||
DEPLOY = os.environ.get("DEPLOYMENT", "android-emulator")
|
||||
API = "https://kubernetes.default.svc"
|
||||
# Use the injected env vars, not DNS: kubernetes.default.svc failed to
|
||||
# resolve from this alpine/musl pod (ndots + injected dns_config quirk).
|
||||
API = "https://%s:%s" % (
|
||||
os.environ.get("KUBERNETES_SERVICE_HOST", "kubernetes.default.svc"),
|
||||
os.environ.get("KUBERNETES_SERVICE_PORT", "443"),
|
||||
)
|
||||
TOKEN_PATH = "/var/run/secrets/kubernetes.io/serviceaccount/token"
|
||||
CA_PATH = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
|
||||
IDLE_ANNOTATION = "emulator.viktorbarzin.me/idle-checks"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue