From 748c5c8ecb23ea63a75b4c84863042bf883d78e9 Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Sat, 28 Mar 2026 14:58:04 +0800 Subject: [PATCH 1/2] fix: set PD_MONGO_URI explicitly for in-cluster mongo When mongo.in_cluster is true, PD_MONGO_URI was not set in the configmap, causing the Go app to fall back to localhost:27017 which doesn't work inside the cluster. Now uses the FQDN mongo..svc.cluster.local with the replicaSet parameter. Co-Authored-By: Claude Opus 4.6 (1M context) --- helm-chart/templates/paperdebugger.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/helm-chart/templates/paperdebugger.yaml b/helm-chart/templates/paperdebugger.yaml index f398a666..b7b4649d 100644 --- a/helm-chart/templates/paperdebugger.yaml +++ b/helm-chart/templates/paperdebugger.yaml @@ -76,6 +76,8 @@ data: INFERENCE_BASE_URL: "{{ .Values.inference_base_url }}" INFERENCE_API_KEY: "{{ .Values.inference_api_key }}" JWT_SIGNING_KEY: "{{ .Values.jwt_signing_key }}" - {{ if not .Values.mongo.in_cluster }} + {{- if .Values.mongo.in_cluster }} + PD_MONGO_URI: "mongodb://mongo.{{ .Values.namespace }}.svc.cluster.local:27017/?replicaSet=in-cluster" + {{- else }} PD_MONGO_URI: "{{ .Values.mongo.uri }}" - {{ end }} \ No newline at end of file + {{- end }} \ No newline at end of file From e237c9daff7812ee5bf922d841d370dd3d89c808 Mon Sep 17 00:00:00 2001 From: Junyi Hou Date: Sat, 28 Mar 2026 15:32:02 +0800 Subject: [PATCH 2/2] fix: set mongo.in_cluster to true for dev and stg Both environments use the in-cluster mongo deployed by the helm chart, so in_cluster should be true. This lets the template generate the correct FQDN automatically, removing the dependency on MONGO_URI_DEV and MONGO_URI_STG secrets. Co-Authored-By: Claude Opus 4.6 (1M context) --- hack/values-dev.yaml | 2 +- hack/values-stg.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/values-dev.yaml b/hack/values-dev.yaml index 20fd0374..c01485b3 100644 --- a/hack/values-dev.yaml +++ b/hack/values-dev.yaml @@ -6,4 +6,4 @@ cloudflareNodeSelector: kubernetes.io/hostname: nuc mongo: - in_cluster: false + in_cluster: true diff --git a/hack/values-stg.yaml b/hack/values-stg.yaml index 4813ce19..3eefbc6c 100644 --- a/hack/values-stg.yaml +++ b/hack/values-stg.yaml @@ -6,4 +6,4 @@ cloudflareNodeSelector: kubernetes.io/hostname: nuc mongo: - in_cluster: false + in_cluster: true