Skip to content

Commit 0604f8d

Browse files
author
7va
committed
fix backend 503 error
1 parent c1bc729 commit 0604f8d

4 files changed

Lines changed: 32 additions & 16 deletions

File tree

helm/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ apiVersion: v2
22
name: opensampl
33
description: Helm chart for OpenSAMPL (Postgres + Backend + Grafana + Migrations)
44
type: application
5-
version: 0.1.6
5+
version: 0.1.7
66
appVersion: "1.0.0"
77
icon: https://raw.githubusercontent.com/ORNL/OpenSAMPL/main/docs/logo.png

helm/templates/backend/deployment.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,21 @@ spec:
3535
image: "{{ .Values.backend.image.repository }}:{{ .Values.backend.image.tag }}"
3636
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
3737
ports:
38-
- containerPort: {{ .Values.backend.port }}
38+
- containerPort: 8000
3939
env:
4040
- name: DATABASE_URL
41-
value: postgresql://{{ .Values.db.username }}:{{ .Values.db.password }}@{{ include "opensampl.fullname" . }}-db:{{ .Values.db.port }}/{{ .Values.db.database }}
41+
value: postgresql://$(POSTGRES_USER):$(POSTGRES_PASSWORD)@{{ include "opensampl.fullname" . }}-db:{{ .Values.db.port }}/{{ .Values.db.database }}
42+
- name: POSTGRES_USER
43+
value: {{ .Values.db.username }}
44+
- name: POSTGRES_PASSWORD
45+
valueFrom:
46+
secretKeyRef:
47+
name: {{ include "opensampl.fullname" . }}-db-secret
48+
key: POSTGRES_PASSWORD
49+
- name: BACKEND_LOG_LEVEL
50+
value: {{ .Values.backend.logLevel | default "INFO" | quote }}
51+
- name: USE_API_KEY
52+
value: {{ .Values.backend.useApiKey | default "false" | quote }}
4253
{{- with .Values.backend.env }}
4354
{{- toYaml . | nindent 12 }}
44-
{{- end }}
55+
{{- end }}

helm/templates/backend/service.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ metadata:
77
spec:
88
type: ClusterIP
99
selector:
10-
app: {{ include "opensampl.name" . }}-backend
10+
app.kubernetes.io/name: {{ include "opensampl.name" . }}
11+
app.kubernetes.io/instance: {{ .Release.Name }}
12+
role: backend
1113
ports:
1214
- name: http
13-
port: 80
15+
port: {{ .Values.backend.service.port }}
1416
targetPort: 8000

helm/values-mariner.yaml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ backend:
2525
service:
2626
type: ClusterIP
2727
port: 8000
28+
logLevel: "INFO"
29+
useApiKey: false
30+
env: []
2831

2932
# Grafana configuration
3033
grafana:
@@ -36,7 +39,7 @@ grafana:
3639
port: 3000
3740
service:
3841
type: ClusterIP
39-
rootUrl: "https://opensampl-test.ornl.gov/grafana/"
42+
rootUrl: "https://opensampl-test.ornl.gov/grafana"
4043
serveFromSubPath: true
4144

4245
# Migrations (disabled until ready)
@@ -53,15 +56,15 @@ ingress:
5356
hosts:
5457
- host: opensampl-test.ornl.gov
5558
paths:
56-
- path: /api(/|$)(.*)
57-
pathType: Prefix
58-
service: backend
59-
- path: /docs(/|$)(.*)
60-
pathType: Prefix
61-
service: backend
62-
- path: /grafana(/|$)(.*)
63-
pathType: Prefix
64-
service: grafana
59+
- path: /api
60+
pathType: prefix
61+
service: backend
62+
- path: /docs
63+
pathType: Prefix
64+
service: backend
65+
- path: /grafana(/|$)(.*)
66+
pathType: Prefix
67+
service: grafana
6568
tls:
6669
- secretName: opensampl-tls
6770
hosts:

0 commit comments

Comments
 (0)