From 1b680d3a54c970e5d24ac72da25d456697972dab Mon Sep 17 00:00:00 2001 From: Julio H Morimoto Date: Tue, 17 Dec 2019 08:40:25 -0300 Subject: [PATCH] Provide better defaults for ingress tls and secretName configuration. (#5859) This patch allows tls to be enabled with an empty secretName for ingress controllers might be able to provide a default certificate. Fixes #5858, provides better defaults for the Ingress object and allows TLS to be enabled with an empty secretName. ### Motivation The current helm chart can create an Ingress with TLS, but it requires a secretName to be added. This is not an Ingress requirement and, in some cases, the ingress controller can provide a default certificate when the Ingress object does not declare one. ### Modifications Modifications include `values.yaml` and `dashboard-ingress.yaml` to address the issue. --- pulsar/templates/dashboard-ingress.yaml | 6 ++++-- pulsar/values.yaml | 8 +++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pulsar/templates/dashboard-ingress.yaml b/pulsar/templates/dashboard-ingress.yaml index e6ebf56..ff9106f 100644 --- a/pulsar/templates/dashboard-ingress.yaml +++ b/pulsar/templates/dashboard-ingress.yaml @@ -34,11 +34,13 @@ metadata: name: "{{ template "pulsar.fullname" . }}-{{ .Values.dashboard.component }}" namespace: {{ .Values.namespace }} spec: -{{- if .Values.dashboard.ingress.tls }} +{{- if .Values.dashboard.ingress.tls.enabled }} tls: - hosts: - {{ .Values.dashboard.ingress.hostname }} - secretName: {{ .Values.dashboard.ingress.tls.secretName }} + {{- with .Values.dashboard.ingress.tls.secretName }} + secretName: {{ . }} + {{- end }} {{- end }} rules: - host: {{ required "Dashboard ingress hostname not provided" .Values.dashboard.ingress.hostname }} diff --git a/pulsar/values.yaml b/pulsar/values.yaml index a9e31b4..69b3ccf 100644 --- a/pulsar/values.yaml +++ b/pulsar/values.yaml @@ -331,7 +331,13 @@ dashboard: ingress: enabled: false annotations: {} - tls: {} + tls: + enabled: false + + ## Optional. Leave it blank if your Ingress Controller can provide a default certificate. + secretName: "" + + ## Required if ingress is enabled hostname: "" path: "/" port: 80