Skip to content

Commit aeb7716

Browse files
initcronclaude
andcommitted
fix(helm): fix dashboard nginx proxy for Kubernetes service names
The dashboard Docker image bakes in a Docker Compose nginx.conf that uses short service names (api-gateway, catalog, worker) and Docker's DNS resolver (127.0.0.11) — neither works in Kubernetes. Add a dashboard-nginx-configmap.yaml that: - Uses prefix locations (/api-gateway/, /catalog/, /worker/) to avoid nginx variables in proxy_pass, which require a resolver directive - Uses Kubernetes service names (reference-app-api-gateway, etc.) resolved via the system resolver at startup Mount the ConfigMap over /etc/nginx/conf.d/default.conf in the dashboard deployment to override the baked-in image config. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8b493de commit aeb7716

2 files changed

Lines changed: 57 additions & 0 deletions

File tree

reference-app/helm/reference-app/templates/dashboard-deployment.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,11 @@ spec:
4141
failureThreshold: 2
4242
resources:
4343
{{- toYaml .Values.dashboard.resources | nindent 12 }}
44+
volumeMounts:
45+
- name: nginx-config
46+
mountPath: /etc/nginx/conf.d/default.conf
47+
subPath: default.conf
48+
volumes:
49+
- name: nginx-config
50+
configMap:
51+
name: {{ include "reference-app.fullname" . }}-nginx
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "reference-app.fullname" . }}-nginx
5+
labels:
6+
{{- include "reference-app.labels" . | nindent 4 }}
7+
data:
8+
default.conf: |
9+
server {
10+
listen 3000;
11+
root /usr/share/nginx/html;
12+
index index.html;
13+
14+
# SPA fallback — serves index.html for all unmatched routes
15+
location / {
16+
try_files $uri $uri/ /index.html;
17+
}
18+
19+
# Proxy /api-gateway/ → api-gateway service (prefix strip — no variables, resolves at startup)
20+
location /api-gateway/ {
21+
proxy_pass http://{{ include "reference-app.fullname" . }}-api-gateway:{{ .Values.apiGateway.service.port }}/;
22+
proxy_set_header Host $host;
23+
proxy_set_header X-Real-IP $remote_addr;
24+
proxy_read_timeout 10s;
25+
}
26+
27+
# Proxy /catalog/ → catalog service
28+
location /catalog/ {
29+
proxy_pass http://{{ include "reference-app.fullname" . }}-catalog:{{ .Values.catalog.service.port }}/;
30+
proxy_set_header Host $host;
31+
proxy_set_header X-Real-IP $remote_addr;
32+
proxy_read_timeout 10s;
33+
}
34+
35+
# Proxy /worker/ → worker service
36+
location /worker/ {
37+
proxy_pass http://{{ include "reference-app.fullname" . }}-worker:{{ .Values.worker.service.port }}/;
38+
proxy_set_header Host $host;
39+
proxy_set_header X-Real-IP $remote_addr;
40+
proxy_read_timeout 10s;
41+
}
42+
43+
# Health check endpoint for container probes
44+
location /nginx-health {
45+
access_log off;
46+
return 200 "ok\n";
47+
add_header Content-Type text/plain;
48+
}
49+
}

0 commit comments

Comments
 (0)