use relative path for backend URLs

This commit is contained in:
Maarten de Waard 2021-10-05 16:13:59 +02:00
parent e15ac52be7
commit 18276be75d
No known key found for this signature in database
GPG key ID: 1D3E893A657CC8DA
7 changed files with 28 additions and 14 deletions

4
.env
View file

@ -1,2 +1,2 @@
REACT_APP_API_URL=https://oas-api.initdevelopment.com/api/v1 REACT_APP_API_URL=/api/v1
EXTEND_ESLINT=true EXTEND_ESLINT=true

3
.gitignore vendored
View file

@ -25,3 +25,6 @@ yarn-error.log*
.eslintcache .eslintcache
cypress/videos/ cypress/videos/
# Helm dependencies
deployment/helmchart/charts/

View file

@ -10,10 +10,8 @@ metadata:
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }} {{- end }}
data: data:
REACT_APP_API_URL: "{{ include "adminBackend.serviceName" .}}" # ADMIN_FRONTEND_HOST: "{{ include "adminFrontend.host" . }}"
EXTEND_ESLINT: "{{ .Values.adminFrontend.extendEslint }}" # ADMIN_BACKEND_HOST: "{{ include "adminBackend.host" . }}"
ADMIN_FRONTEND_HOST: "{{ include "adminFrontend.host" . }}"
ADMIN_BACKEND_HOST: "{{ include "adminBackend.host" . }}"
# Probably needed in the future: # Probably needed in the future:
# ADMIN_BACKEND_USERNAME: {{ .Values.adminBackend.username | quote }} # ADMIN_BACKEND_USERNAME: {{ .Values.adminBackend.username | quote }}
# ADMIN_BACKEND_EMAIL: {{ .Values.adminBackend.email | quote }} # ADMIN_BACKEND_EMAIL: {{ .Values.adminBackend.email | quote }}

View file

@ -87,7 +87,7 @@ spec:
{{- if .Values.adminFrontend.livenessProbe.enabled }} {{- if .Values.adminFrontend.livenessProbe.enabled }}
livenessProbe: livenessProbe:
httpGet: httpGet:
path: /srv/status path: /
port: frontend-http port: frontend-http
initialDelaySeconds: {{ .Values.adminFrontend.livenessProbe.initialDelaySeconds }} initialDelaySeconds: {{ .Values.adminFrontend.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.adminFrontend.livenessProbe.periodSeconds }} periodSeconds: {{ .Values.adminFrontend.livenessProbe.periodSeconds }}
@ -100,7 +100,7 @@ spec:
{{- if .Values.adminFrontend.readinessProbe.enabled }} {{- if .Values.adminFrontend.readinessProbe.enabled }}
readinessProbe: readinessProbe:
httpGet: httpGet:
path: /srv/status path: /
port: frontend-http port: frontend-http
initialDelaySeconds: {{ .Values.adminFrontend.readinessProbe.initialDelaySeconds }} initialDelaySeconds: {{ .Values.adminFrontend.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.adminFrontend.readinessProbe.periodSeconds }} periodSeconds: {{ .Values.adminFrontend.readinessProbe.periodSeconds }}
@ -161,7 +161,7 @@ spec:
{{- if .Values.adminBackend.livenessProbe.enabled }} {{- if .Values.adminBackend.livenessProbe.enabled }}
livenessProbe: livenessProbe:
httpGet: httpGet:
path: /srv/status path: /
port: backend-http port: backend-http
initialDelaySeconds: {{ .Values.adminBackend.livenessProbe.initialDelaySeconds }} initialDelaySeconds: {{ .Values.adminBackend.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.adminBackend.livenessProbe.periodSeconds }} periodSeconds: {{ .Values.adminBackend.livenessProbe.periodSeconds }}
@ -174,7 +174,7 @@ spec:
{{- if .Values.adminBackend.readinessProbe.enabled }} {{- if .Values.adminBackend.readinessProbe.enabled }}
readinessProbe: readinessProbe:
httpGet: httpGet:
path: /srv/status path: /
port: backend-http port: backend-http
initialDelaySeconds: {{ .Values.adminBackend.readinessProbe.initialDelaySeconds }} initialDelaySeconds: {{ .Values.adminBackend.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.adminBackend.readinessProbe.periodSeconds }} periodSeconds: {{ .Values.adminBackend.readinessProbe.periodSeconds }}

View file

@ -41,6 +41,12 @@ spec:
pathType: {{ .Values.ingress.pathType }} pathType: {{ .Values.ingress.pathType }}
{{- end }} {{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "adminFrontend.serviceName" .) "servicePort" "frontend-http" "context" $) | nindent 14 }} backend: {{- include "common.ingress.backend" (dict "serviceName" (include "adminFrontend.serviceName" .) "servicePort" "frontend-http" "context" $) | nindent 14 }}
# Forward API calls to the back-end container
- path: {{ .Values.ingress.path }}api/v1
{{- if eq "true" (include "common.ingress.supportsPathType" .) }}
pathType: {{ .Values.ingress.pathType }}
{{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "adminBackend.serviceName" .) "servicePort" "backend-http" "context" $) | nindent 14 }}
{{- end }} {{- end }}
{{- range .Values.ingress.extraHosts }} {{- range .Values.ingress.extraHosts }}
- host: {{ .name }} - host: {{ .name }}
@ -51,5 +57,10 @@ spec:
pathType: {{ default "ImplementationSpecific" .pathType }} pathType: {{ default "ImplementationSpecific" .pathType }}
{{- end }} {{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "adminFrontend.serviceName" $) "servicePort" "frontend-http" "context" $) | nindent 14 }} backend: {{- include "common.ingress.backend" (dict "serviceName" (include "adminFrontend.serviceName" $) "servicePort" "frontend-http" "context" $) | nindent 14 }}
- path: {{ default "/" .path }}api/v1
{{- if eq "true" (include "common.ingress.supportsPathType" $) }}
pathType: {{ default "ImplementationSpecific" .pathType }}
{{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "adminBackend.serviceName" .) "servicePort" "backend-http" "context" $) | nindent 14 }}
{{- end }} {{- end }}
{{- end }} {{- end }}

View file

@ -4,6 +4,8 @@ adminFrontend:
enabled: false enabled: false
readinessProbe: readinessProbe:
enabled: false enabled: false
image:
tag: 2-add-helm-chart
adminBackend: adminBackend:
livenessProbe: livenessProbe:

View file

@ -165,7 +165,7 @@ adminFrontend:
## ##
livenessProbe: livenessProbe:
enabled: true enabled: true
initialDelaySeconds: 500 initialDelaySeconds: 10
periodSeconds: 10 periodSeconds: 10
timeoutSeconds: 5 timeoutSeconds: 5
failureThreshold: 6 failureThreshold: 6
@ -183,7 +183,7 @@ adminFrontend:
## ##
readinessProbe: readinessProbe:
enabled: true enabled: true
initialDelaySeconds: 30 initialDelaySeconds: 10
periodSeconds: 10 periodSeconds: 10
timeoutSeconds: 5 timeoutSeconds: 5
failureThreshold: 6 failureThreshold: 6
@ -377,7 +377,7 @@ adminBackend:
## ##
livenessProbe: livenessProbe:
enabled: true enabled: true
initialDelaySeconds: 500 initialDelaySeconds: 10
periodSeconds: 10 periodSeconds: 10
timeoutSeconds: 5 timeoutSeconds: 5
failureThreshold: 6 failureThreshold: 6
@ -395,7 +395,7 @@ adminBackend:
## ##
readinessProbe: readinessProbe:
enabled: true enabled: true
initialDelaySeconds: 30 initialDelaySeconds: 10
periodSeconds: 10 periodSeconds: 10
timeoutSeconds: 5 timeoutSeconds: 5
failureThreshold: 6 failureThreshold: 6