You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/09/15 04:52:52 UTC

[GitHub] [airflow] jedcunningham commented on a change in pull request #18257: Ability to access http k8s via multiple hostnames

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



##########
File path: chart/values.schema.json
##########
@@ -126,10 +126,15 @@
                             "default": ""
                         },
                         "host": {
-                            "description": "The hostname for the web Ingress.",
+                            "description": "The hostname for the web Ingress. (Deprecated - renamed to `ingress.web.hosts`)",
                             "type": "string",
                             "default": ""
                         },
+                        "hosts": {
+                            "description": "The hostnames for the web Ingress.",
+                            "type": "array",

Review comment:
       ```suggestion
                               "type": "array",
                               "items": {
                                   "type": "string"
                               },
   ```

##########
File path: chart/values.schema.json
##########
@@ -126,10 +126,15 @@
                             "default": ""
                         },
                         "host": {
-                            "description": "The hostname for the web Ingress.",
+                            "description": "The hostname for the web Ingress. (Deprecated - renamed to `ingress.web.hosts`)",

Review comment:
       Also in `UPDATING.rst`?

##########
File path: chart/values.schema.json
##########
@@ -126,10 +126,15 @@
                             "default": ""
                         },
                         "host": {
-                            "description": "The hostname for the web Ingress.",
+                            "description": "The hostname for the web Ingress. (Deprecated - renamed to `ingress.web.hosts`)",
                             "type": "string",
                             "default": ""
                         },
+                        "hosts": {
+                            "description": "The hostnames for the web Ingress.",
+                            "type": "array",
+                            "default": []

Review comment:
       There should be a corresponding param added to `values.yaml` too.

##########
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 }}

Review comment:
       ```suggestion
           {{- .Values.ingress.web.hosts | default (list .Values.ingress.web.host) | toYaml | nindent 8 }}
   ```
   
   I think using `toYaml` is cleaner, thoughts?

##########
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:
       ```suggestion
         host: {{ . | quote }}
   ```
   
   Not needed, right?




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org