From 5921825ca55f00aa9327fffee83a784e46df071f Mon Sep 17 00:00:00 2001 From: Roman Martin Gil Date: Thu, 4 May 2023 13:59:49 +0200 Subject: [PATCH] Deploy OpenShift route for external communications --- charts/kafka-ui/templates/route.yaml | 26 ++++++++++++++++++++++++++ charts/kafka-ui/values.yaml | 17 +++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 charts/kafka-ui/templates/route.yaml diff --git a/charts/kafka-ui/templates/route.yaml b/charts/kafka-ui/templates/route.yaml new file mode 100644 index 0000000000..24ef6cee55 --- /dev/null +++ b/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 }} diff --git a/charts/kafka-ui/values.yaml b/charts/kafka-ui/values.yaml index 3c30b40813..d28380c198 100644 --- a/charts/kafka-ui/values.yaml +++ b/charts/kafka-ui/values.yaml @@ -130,6 +130,23 @@ ingress: # Http paths to add to the Ingress after the default path 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: {} # limits: