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
@@ -127,3 +127,46 @@ Create the mongodb connection string.
{{- end -}} {{- end -}}
{{- printf "%s" $connectionString -}} {{- printf "%s" $connectionString -}}
{{- end -}} {{- 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 }}
@@ -89,5 +89,4 @@ stringData:
{{- $v := $value | default ($current | default $default) -}} {{- $v := $value | default ($current | default $default) -}}
{{ $key }}: {{ $v | quote }} {{ $key }}: {{ $v | quote }}
{{ end -}} {{ end -}}
MONGO_URL: {{ include "infisical.mongodb.connectionString" . | quote }}
{{- end }} {{- end }}
+1 -18
View File
@@ -27,22 +27,5 @@ spec:
secretName: {{ .secretName }} secretName: {{ .secretName }}
{{- end }} {{- end }}
{{- end }} {{- end }}
rules: {{- include "infisical.ingress-rules" . | nindent 2 }}
- 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
{{ end }} {{ end }}
+5 -3
View File
@@ -303,13 +303,14 @@ ingress:
ingressClassName: nginx ingressClassName: nginx
## @param ingress.annotations Ingress annotations ## @param ingress.annotations Ingress annotations
## ##
annotations: {} annotations:
{}
# kubernetes.io/ingress.class: "nginx" # kubernetes.io/ingress.class: "nginx"
# cert-manager.io/issuer: letsencrypt-nginx # cert-manager.io/issuer: letsencrypt-nginx
## @param ingress.hostName Ingress hostname (your custom domain name) ## @param ingress.hostName Ingress hostname (your custom domain name)
## Replace with your own domain ## Replace with your own domain
## ##
hostName: infisical.local hostName: ""
## @skip ingress.frontend ## @skip ingress.frontend
## ##
frontend: frontend:
@@ -396,7 +397,8 @@ mailhog:
ingressClassName: nginx ingressClassName: nginx
## @param mailhog.ingress.annotations Ingress annotations ## @param mailhog.ingress.annotations Ingress annotations
## ##
annotations: {} annotations:
{}
# kubernetes.io/ingress.class: nginx # kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true" # kubernetes.io/tls-acme: "true"
## @param mailhog.ingress.labels Ingress labels ## @param mailhog.ingress.labels Ingress labels