mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 12:03:59 +00:00
Follow-up to 391c4f5. Live deploy showed GCE's L7 BackendConfig CRD
hard-rejects type: TCP with:
Error syncing to GCP: error running backend syncing routine:
error ensuring health check:
Protocol "TCP" is not valid, must be one of [HTTP,HTTPS,HTTP2]
The sync never completes, so the LB has no healthy backend and TCP
connections to the public endpoint just close (ERR_CONNECTION_CLOSED).
Fix: switch all three BackendConfigs to type: HTTP with request paths
that return 200:
- supabase-kong & knoe-svc-kong: add a dedicated /healthz route to the
Kong declarative config via the request-termination plugin, which
returns 200 synchronously with no upstream call. Equivalent liveness
semantics to the TCP check we wanted (backend is alive as long as Kong
accepts connections) but over HTTP, which GCE actually accepts.
- supabase/helm/knoe-supabase/templates/kong/config.yaml
- etc/init_kong.sh (inline kong.yml heredoc)
- supabase-studio: Studio returns 301 on / (Next.js default) so we
point the probe at /favicon.ico -- Next.js serves it as a static asset
with 200 unconditionally. Not as clean as a real readiness endpoint
but Studio does not expose one that returns 200 without auth.
- supabase/helm/knoe-supabase/templates/studio/backendconfig.yaml
Verified locally via helm template -f values.generated.json: the
rendered BackendConfigs come out with the HTTP protocol + correct paths,
and the Kong ConfigMap has the healthz service block before the
auth-v1-open service.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
43 lines
1.5 KiB
YAML
43 lines
1.5 KiB
YAML
{{- /*
|
|
GCE L7 BackendConfig for supabase-kong.
|
|
|
|
GCE's default Ingress healthCheck is HTTP GET `/` on the backend port; Kong
|
|
returns 404 on any unrouted path, so the backend never goes HEALTHY and the
|
|
LB serves "Server Error" instead of reaching the proxy.
|
|
|
|
We wanted TCP liveness semantics (backend is alive as long as Kong accepts
|
|
connections) but GCE's BackendConfig CRD only accepts HTTP/HTTPS/HTTP2 --
|
|
it rejects `type: TCP` with
|
|
`Protocol "TCP" is not valid, must be one of [HTTP,HTTPS,HTTP2]`
|
|
|
|
Workaround: HTTP against a dedicated `/healthz` route we add to Kong's
|
|
declarative config (templates/kong/config.yaml) with the request-termination
|
|
plugin returning 200 synchronously, no upstream call. Equivalent liveness
|
|
semantics via a protocol GCE accepts.
|
|
|
|
The companion Service template (kong/service.yaml) annotates the Service
|
|
with cloud.google.com/backend-config so GCE picks this up.
|
|
|
|
Only rendered when .Values.service.kong.backendConfigName is set
|
|
(render_supabase.py populates it in k8s/GKE mode).
|
|
*/ -}}
|
|
{{- if and .Values.deployment.kong.enabled (.Values.service.kong.backendConfigName | default "") -}}
|
|
apiVersion: cloud.google.com/v1
|
|
kind: BackendConfig
|
|
metadata:
|
|
name: {{ .Values.service.kong.backendConfigName | quote }}
|
|
labels:
|
|
{{- include "supabase.labels" . | nindent 4 }}
|
|
spec:
|
|
healthCheck:
|
|
type: HTTP
|
|
requestPath: /healthz
|
|
port: {{ .Values.service.kong.port | default 8000 }}
|
|
checkIntervalSec: 15
|
|
timeoutSec: 5
|
|
healthyThreshold: 1
|
|
unhealthyThreshold: 3
|
|
connectionDraining:
|
|
drainingTimeoutSec: 30
|
|
{{- end }}
|