fix(chart): simplified ingress rules configuration

This commit is contained in:
Grraahaam
2023-04-01 00:17:06 +02:00
parent 7c33b6159f
commit dd10bf1702
2 changed files with 22 additions and 45 deletions

View File

@@ -122,51 +122,9 @@ Create the mongodb connection string.
{{- $pass := first .Values.mongodb.auth.passwords | default "root" -}}
{{- $database := first .Values.mongodb.auth.databases | default "test" -}}
{{- $connectionString := printf "mongodb://%s:%s@%s:%d/%s" $user $pass $host $port $database -}}
{{/* Backward compatibility (< 0.1.16, deprecated) */}}
{{- if .Values.mongodbConnection.externalMongoDBConnectionString -}}
{{- $connectionString = .Values.mongodbConnection.externalMongoDBConnectionString -}}
{{- end -}}
{{- printf "%s" $connectionString -}}
{{- end -}}
{{- define "infisical.ingress-rules" -}}
{{- $ingress := .Values.ingress }}
{{- if $ingress.hostName }}
rules:
- host: {{ $ingress.hostName }}
http:
paths:
- path: {{ $ingress.frontend.path }}
pathType: {{ $ingress.frontend.pathType }}
backend:
service:
name: {{ include "infisical.frontend.fullname" . }}
port:
number: 3000
- path: {{ $ingress.backend.path }}
pathType: {{ $ingress.backend.pathType }}
backend:
service:
name: {{ include "infisical.backend.fullname" . }}
port:
number: 4000
{{- else }}
rules:
- http:
paths:
- path: {{ $ingress.frontend.path }}
pathType: {{ $ingress.frontend.pathType }}
backend:
service:
name: {{ include "infisical.frontend.fullname" . }}
port:
number: 3000
- path: {{ $ingress.backend.path }}
pathType: {{ $ingress.backend.pathType }}
backend:
service:
name: {{ include "infisical.backend.fullname" . }}
port:
number: 4000
{{- end }}
{{- end }}
{{- end -}}

View File

@@ -27,5 +27,24 @@ spec:
secretName: {{ .secretName }}
{{- end }}
{{- end }}
{{- include "infisical.ingress-rules" . | nindent 2 }}
rules:
- http:
paths:
- path: {{ $ingress.frontend.path }}
pathType: {{ $ingress.frontend.pathType }}
backend:
service:
name: {{ include "infisical.frontend.fullname" . }}
port:
number: 3000
- path: {{ $ingress.backend.path }}
pathType: {{ $ingress.backend.pathType }}
backend:
service:
name: {{ include "infisical.backend.fullname" . }}
port:
number: 4000
{{- if $ingress.hostName }}
host: {{ $ingress.hostName }}
{{- end }}
{{ end }}