chore: refine deploy.sh and Supabase ingress timeout diagnostics

- Simplified public APP endpoint fallback logic in `deploy.sh`.
- Enhanced timeout handling with detailed Supabase ingress reconciliation diagnostics.
- Removed redundant ingress class override in Helm template for Supabase.
This commit is contained in:
chrisfu 2026-04-15 22:32:41 -07:00
parent e3b1ed21c9
commit 7c46b52e7e
2 changed files with 12 additions and 18 deletions

View File

@ -52,23 +52,7 @@ def get_ip(host, ctx):
except: pass
# Public APP endpoints must be sourced from Ingress status
if host in ["api.knoe.dev", "git.knoe.dev", "svc.knoe.dev", "api.0.knoe.dev", "db.0.knoe.dev"]:
return "pending"
# Try Service fallback
try:
svcs = []
if "git" in host: svcs = [("gitlab", "gitlab-nginx-ingress-controller")]
elif "api.knoe" in host or "svc.knoe" in host: svcs = [("knoe-system", "knoe-svc-kong-proxy")]
elif "0.knoe" in host: svcs = [("supabase", "kong"), ("supabase", "studio")]
for ns, name in svcs:
out = subprocess.check_output(["kubectl", "--context", ctx, "get", "svc", "-n", ns, name, "-o", "json"], stderr=subprocess.DEVNULL, text=True)
ing = json.loads(out).get("status", {}).get("loadBalancer", {}).get("ingress", [])
if ing:
val = ing[0].get("ip") or ing[0].get("hostname")
if val: return val
except: pass
# api.knoe.dev, git.knoe.dev, svc.knoe.dev, api.0.knoe.dev, db.0.knoe.dev
return "pending"
app_ctx, db_ctx = get_config(sys.argv[1])
@ -88,6 +72,17 @@ while time.time() - start < timeout:
break
time.sleep(10)
if time.time() - start >= timeout:
print("\nERROR: Timeout waiting for Supabase ingress reconciliation.")
print("Ingress Controller Diagnosis (kubectl get events -n supabase):")
try:
subprocess.run(["kubectl", "--context", app_ctx, "get", "events", "-n", "supabase", "--sort-by=.lastTimestamp"], check=False)
print("\nIngress Resource Status:")
subprocess.run(["kubectl", "--context", app_ctx, "describe", "ingress", "supabase-public", "-n", "supabase"], check=False)
except:
pass
sys.exit(1)
endpoints = [
("api.knoe.dev", "knoe-svc-kong", "APP", app_ctx),
("git.knoe.dev", "GitLab", "APP", app_ctx),

View File

@ -824,7 +824,6 @@ def _build_overlay(cfg: configparser.ConfigParser, args: argparse.Namespace) ->
"fullnameOverride": "supabase",
"publicIngress": {
"enabled": mode == "k8s",
"className": api_ingress_class if mode == "k8s" else "",
"rules": rules_public,
"annotations": {
"kubernetes.io/ingress.class": api_ingress_class,