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.
This commit is contained in:
Julio H Morimoto 2019-12-17 08:40:25 -03:00 committed by Jia Zhai
parent 44ce326879
commit 1b680d3a54
2 changed files with 11 additions and 3 deletions

View File

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

View File

@ -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