Make host name optional

This commit is contained in:
Maidul Islam
2023-03-27 14:19:05 -07:00
parent 0008ff9a98
commit 68deea28b7
4 changed files with 49 additions and 22 deletions

View File

@@ -127,3 +127,46 @@ Create the mongodb connection string.
{{- 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 }}

View File

@@ -89,5 +89,4 @@ stringData:
{{- $v := $value | default ($current | default $default) -}}
{{ $key }}: {{ $v | quote }}
{{ end -}}
MONGO_URL: {{ include "infisical.mongodb.connectionString" . | quote }}
{{- end }}

View File

@@ -27,22 +27,5 @@ spec:
secretName: {{ .secretName }}
{{- end }}
{{- end }}
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
{{- include "infisical.ingress-rules" . | nindent 2 }}
{{ end }}

View File

@@ -303,13 +303,14 @@ ingress:
ingressClassName: nginx
## @param ingress.annotations Ingress annotations
##
annotations: {}
annotations:
{}
# kubernetes.io/ingress.class: "nginx"
# cert-manager.io/issuer: letsencrypt-nginx
## @param ingress.hostName Ingress hostname (your custom domain name)
## Replace with your own domain
##
hostName: infisical.local
hostName: ""
## @skip ingress.frontend
##
frontend:
@@ -396,7 +397,8 @@ mailhog:
ingressClassName: nginx
## @param mailhog.ingress.annotations Ingress annotations
##
annotations: {}
annotations:
{}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
## @param mailhog.ingress.labels Ingress labels