Browse Source

feat: Introducing precedingPaths in the Ingress object. With the help of the precedingPaths you can to SSL redirect on the ingress controller side. Inspired by Airflow Helm chart web ingress object.

BREAKING CHANGE: Ingress object changed.
andormarkus 4 years ago
parent
commit
7482465943
2 changed files with 45 additions and 18 deletions
  1. 22 14
      charts/kafka-ui/templates/ingress.yaml
  2. 23 4
      charts/kafka-ui/values.yaml

+ 22 - 14
charts/kafka-ui/templates/ingress.yaml

@@ -16,26 +16,34 @@ metadata:
     {{- toYaml . | nindent 4 }}
     {{- toYaml . | nindent 4 }}
   {{- end }}
   {{- end }}
 spec:
 spec:
-  {{- if .Values.ingress.tls }}
+  {{- if .Values.ingress.tls.enabled }}
   tls:
   tls:
-    {{- range .Values.ingress.tls }}
     - hosts:
     - hosts:
-        {{- range .hosts }}
-        - {{ . | quote }}
-        {{- end }}
-      secretName: {{ .secretName }}
-    {{- end }}
+        - {{ .Values.ingress.host }}
+      secretName: {{ .Values.ingress.tls.secretName }}
   {{- end }}
   {{- end }}
   rules:
   rules:
-    {{- range .Values.ingress.hosts }}
-    - host: {{ .host | quote }}
-      http:
+    - http:
         paths:
         paths:
-          {{- range .paths }}
-          - path: {{ . }}
+          {{- range .Values.ingress.precedingPaths }}
+          - path: {{ .path }}
             backend:
             backend:
+              serviceName: {{ .serviceName }}
+              servicePort: {{ .servicePort }}
+          {{- end }}
+          - backend:
               serviceName: {{ $fullName }}
               serviceName: {{ $fullName }}
               servicePort: {{ $svcPort }}
               servicePort: {{ $svcPort }}
+{{- if .Values.ingress.path }}
+            path: {{ .Values.ingress.path }}
+{{- end }}
+          {{- range .Values.ingress.succeedingPaths }}
+          - path: {{ .path }}
+            backend:
+              serviceName: {{ .serviceName }}
+              servicePort: {{ .servicePort }}
           {{- end }}
           {{- end }}
-    {{- end }}
-  {{- end }}
+{{- if .Values.ingress.host }}
+      host: {{ .Values.ingress.host }}
+{{- end }}
+  {{- end }}

+ 23 - 4
charts/kafka-ui/values.yaml

@@ -44,13 +44,32 @@ service:
   # if you want to force a specific nodePort. Must be use with service.type=NodePort
   # if you want to force a specific nodePort. Must be use with service.type=NodePort
   # nodePort:
   # nodePort:
 
 
+# Ingress configuration
 ingress:
 ingress:
+  # Enable ingress resource
   enabled: false
   enabled: false
+
+  # Annotations for the Ingress
   annotations: {}
   annotations: {}
-  hosts:
-    - host: chart-example.local
-      paths: []
-  tls: []
+
+  # The path for the Ingress
+  path: ""
+
+  # The hostname for the Ingress
+  host: ""
+
+  # configs for Ingress TLS
+  tls:
+    # Enable TLS termination for the Ingress
+    enabled: false
+    # the name of a pre-created Secret containing a TLS private key and certificate
+    secretName: ""
+
+  # HTTP paths to add to the Ingress before the default path
+  precedingPaths: []
+
+  # Http paths to add to the Ingress after the default path
+  succeedingPaths: []
 
 
 resources: {}
 resources: {}
   # limits:
   # limits: