fredthomsen commented on a change in pull request #18257:
URL: https://github.com/apache/airflow/pull/18257#discussion_r709721735



##########
File path: chart/templates/webserver/webserver-ingress.yaml
##########
@@ -39,31 +39,38 @@ spec:
   {{- if .Values.ingress.web.tls.enabled }}
   tls:
     - hosts:
-        - {{ .Values.ingress.web.host }}
+{{- if .Values.ingress.web.tls.enabled }}
+        {{- range .Values.ingress.web.hosts | default (list 
.Values.ingress.web.host) }}
+        - {{ . | quote }}
+        {{- end }}
+{{- end }}
       secretName: {{ .Values.ingress.web.tls.secretName }}
   {{- end }}
   rules:
+    {{- range .Values.ingress.web.hosts | default (list 
.Values.ingress.web.host) }}
     - http:
         paths:
-          {{- range .Values.ingress.web.precedingPaths }}
+          {{- range $.Values.ingress.web.precedingPaths }}
           - path: {{ .path }}
             backend:
               serviceName: {{ .serviceName }}
               servicePort: {{ .servicePort }}
           {{- end }}
           - backend:
-              serviceName: {{ .Release.Name }}-webserver
+              serviceName: {{ $.Release.Name }}-webserver
               servicePort: airflow-ui
-{{- if .Values.ingress.web.path }}
-            path: {{ .Values.ingress.web.path }}
+{{- if $.Values.ingress.web.path }}
+            path: {{ $.Values.ingress.web.path }}
 {{- end }}
-          {{- range .Values.ingress.web.succeedingPaths }}
+          {{- range $.Values.ingress.web.succeedingPaths }}
           - path: {{ .path }}
             backend:
               serviceName: {{ .serviceName }}
               servicePort: {{ .servicePort }}
           {{- end }}
-{{- if .Values.ingress.web.host }}
-      host: {{ .Values.ingress.web.host }}
+
+{{- if . }}
+      host: {{ . | quote }}
 {{- end }}

Review comment:
       Yes it would be.  The k8s ingress docs say without a host specified the 
rule matches anything trying to hit the ingress via an IP address ie no host 
http header.  Now I know this definitely doesn't work on the ingress nginx 
controller, but no clue about the other ingress controllers.  
   
   However, in running `helm template` for a few scenarios, wrapping this 
conditional around the host entry does make a difference.  If just 
`.Values.web.ingress.enabled` is set to `true` and everything else is kept as 
the defaults, then the host entry will NOT show up with the conditional 
present, but if that conditional is removed, then host will should up as an 
empty string ie the default value.  How that's dealt with seems to depend on 
the ingress controller.
   
   I am of the mind to leave this as is, unless there is some other data/docs 
that says the above difference doesn't matter.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to