From 63b731e9312ba26c88033324ca74629b09ec010e Mon Sep 17 00:00:00 2001 From: fchinembiri Date: Tue, 21 Jul 2026 22:47:59 +0200 Subject: [PATCH] fix(nextgen): add PORT env var to deployment template and add host rules --- k8s/nextgen/manual-deployments.yaml | 15 +++++++++++++++ .../next-gen-chart/templates/deployment.yaml | 9 +++++++++ 2 files changed, 24 insertions(+) diff --git a/k8s/nextgen/manual-deployments.yaml b/k8s/nextgen/manual-deployments.yaml index 43bda51..5bc0f6f 100644 --- a/k8s/nextgen/manual-deployments.yaml +++ b/k8s/nextgen/manual-deployments.yaml @@ -28,6 +28,8 @@ spec: value: "/app/data/school.db" - name: JWT_SECRET value: "africa-alert-production-secret-2024" + - name: ALLOWED_ORIGINS + value: "https://main.next-gen.techarvest.co.zw,https://next-gen.techarvest.co.zw,http://localhost:3000" ports: - name: http containerPort: 3001 @@ -70,6 +72,8 @@ spec: value: "/app/data/school.db" - name: JWT_SECRET value: "africa-alert-dev-secret-2024" + - name: ALLOWED_ORIGINS + value: "https://dev.next-gen.techarvest.co.zw,http://localhost:3000" ports: - name: http containerPort: 3001 @@ -151,9 +155,20 @@ spec: ingressClassName: nginx tls: - hosts: + - main.next-gen.techarvest.co.zw - next-gen.techarvest.co.zw secretName: next-gen-main-tls rules: + - host: main.next-gen.techarvest.co.zw + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: next-gen-main + port: + number: 80 - host: next-gen.techarvest.co.zw http: paths: diff --git a/k8s/nextgen/next-gen-chart/templates/deployment.yaml b/k8s/nextgen/next-gen-chart/templates/deployment.yaml index 1e90e71..bfe2c7a 100644 --- a/k8s/nextgen/next-gen-chart/templates/deployment.yaml +++ b/k8s/nextgen/next-gen-chart/templates/deployment.yaml @@ -27,6 +27,15 @@ spec: - name: http containerPort: {{ .Values.service.port }} protocol: TCP + env: + - name: PORT + value: "{{ .Values.service.port }}" + - name: NODE_ENV + value: "production" + - name: DB_PATH + value: "/app/data/school.db" + - name: JWT_SECRET + value: "africa-alert-production-secret-2024" resources: {{- toYaml .Values.resources | nindent 12 }}