Browse Source

Deploy OpenShift route for external communications

Roman Martin Gil 2 years ago
parent
commit
5921825ca5
2 changed files with 43 additions and 0 deletions
  1. 26 0
      charts/kafka-ui/templates/route.yaml
  2. 17 0
      charts/kafka-ui/values.yaml

+ 26 - 0
charts/kafka-ui/templates/route.yaml

@@ -0,0 +1,26 @@
+{{- if .Values.route.enabled -}}
+{{- $fullName := include "kafka-ui.fullname" . -}}
+{{- $svcPort := (eq (int .Values.service.port) 80) | ternary "http" .Values.service.port -}}
+kind: Route
+apiVersion: route.openshift.io/v1
+metadata:
+  name: {{ $fullName }}
+  labels:
+    {{- include "kafka-ui.labels" . | nindent 4 }}
+  {{- with .Values.route.annotations }}
+  annotations:
+    {{- toYaml . | nindent 4 }}
+  {{- end }}
+spec:
+  to:
+    kind: Service
+    name: {{ $fullName }}
+    weight: 100
+  port:
+    targetPort: {{ $svcPort | quote }}
+  {{- if .Values.route.tls.enabled }}    
+  tls:
+    termination: {{ .Values.route.tls.termination }}
+    insecureEdgeTerminationPolicy: {{ .Values.route.tls.insecureEdgeTerminationPolicy }}
+  {{- end }}
+{{- end }}

+ 17 - 0
charts/kafka-ui/values.yaml

@@ -130,6 +130,23 @@ ingress:
   # Http paths to add to the Ingress after the default path
   # Http paths to add to the Ingress after the default path
   succeedingPaths: []
   succeedingPaths: []
 
 
+# OpenShift Route configuration
+route:
+  # Enable OpenShift Route resource
+  enabled: false
+
+  # Annotations for OpenShift Route
+  annotations: {}
+
+  # configs for OpenShift Route TLS
+  tls:
+    # Enable TLS termination for the OpenShift Route
+    enabled: false
+    # TLS termination
+    termination: edge
+    # Insecure Edge Termination Policy
+    insecureEdgeTerminationPolicy: Redirect
+
 resources:
 resources:
   {}
   {}
   # limits:
   # limits: