fix(gke): point web backend health check at /login (no healthy upstream)#6
Merged
Merged
Conversation
The GKE Gateway-provisioned GCP LB was health-checking the web backend at the default path '/'. Next.js returns 307 → /login at '/' (signed-in state lives in a session cookie); GCP LBs treat anything other than 2xx as UNHEALTHY, so the backend NEG was perma-UNHEALTHY and the public domain served "no healthy upstream" 503s on every deploy. Earlier fix (31d8f81 "point web probes at /login") fixed the kubelet- side livenessProbe / readinessProbe but not the LB-side health check — those are configured separately via HealthCheckPolicy on the Service. Verified live: - Backend service health flips UNHEALTHY → HEALTHY ~45s after apply. - `curl -sI https://langprobe.daz.co.in/login` returns 200. - `curl -sI https://langprobe.daz.co.in/` returns 307 (correct Next.js redirect, not the LB error). Signed-off-by: Gaurav Dubey <gauravdubey0107@gmail.com> Signed-off-by: gaurav0107 <gauravdubey0107@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
https://langprobe.daz.co.in/returns "no healthy upstream" even though thetracebility-webpod isRunningand1/1 Ready.Root cause
The GCP L7 LB provisioned by the
tracebility-webGateway was health-checking the web backend at path/. Next.js returns307 → /loginat/(signed-in routing). GCP backend health checks treat anything other than2xxasUNHEALTHY, so the backend NEG sat perma-UNHEALTHY and the LB returned 503s.A prior fix (commit
31d8f81"point web probes at /login") fixed the kubelet-sidelivenessProbe/readinessProbe, but the LB-side health check is configured separately — by default the GKE Gateway controller derives it from the backend Service and falls back to/on port7090. The override mechanism isHealthCheckPolicy.networking.gke.iotargeting the Service.Fix
Add
deploy/k8s/gke-gateway/healthcheckpolicy.yaml:Updated
README.mdto document the file alongsidegateway.yaml/httproute.yaml.Verified live
kubectl apply -f.gcloud compute health-checks describe …confirmsrequestPath: /login.UNHEALTHY → HEALTHY~45s after apply.curl -sI https://langprobe.daz.co.in/login→ 200.curl -sI https://langprobe.daz.co.in/→ 307 (correct Next redirect, not the LB 503).Test plan
helm-deployrollouts that recreate the Service don't lose the policy (HealthCheckPolicy is namespaced and survives Service recreation as long as the targetRef name staystracebility-web).🤖 Generated with Claude Code