Skip to content

Commit

Permalink
[Helm] Use default ingress TLS certificate if tls.secretName is not s…
Browse files Browse the repository at this point in the history
…et (#18259)

Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
  • Loading branch information
mmorhun committed Nov 10, 2020
1 parent c3a51fc commit 0815cdb
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ spec:
tls:
- hosts:
- {{ template "devfileRegistryHost" . }}
{{- if .Values.global.tls.secretName }}
secretName: {{ .Values.global.tls.secretName }}
{{- end -}}
{{- end -}}

{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ spec:
tls:
- hosts:
- {{ template "jaegerHost" . }}
{{- if .Values.global.tls.secretName }}
secretName: {{ .Values.global.tls.secretName }}
{{- end -}}
{{- end }}
rules:
- host: {{ template "jaegerHost" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ spec:
tls:
- hosts:
- {{ template "keycloakHost" . }}
{{- if .Values.global.tls.secretName }}
secretName: {{ .Values.global.tls.secretName }}
{{- end -}}
{{- end }}
rules:
{{- if eq .Values.global.serverStrategy "default-host" }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ spec:
tls:
- hosts:
- {{ template "pluginRegistryHost" . }}
{{- if .Values.global.tls.secretName }}
secretName: {{ .Values.global.tls.secretName }}
{{- end -}}
{{- end -}}

{{- end }}
2 changes: 1 addition & 1 deletion deploy/kubernetes/helm/che/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ data:
CHE_INFRA_KUBERNETES_MASTER__URL: ""
{{- if and .Values.global.tls .Values.global.tls.enabled }}
CHE_INFRA_KUBERNETES_TLS__ENABLED: {{ .Values.global.tls.enabled | quote}}
CHE_INFRA_KUBERNETES_TLS__SECRET: {{ .Values.global.tls.secretName }}
CHE_INFRA_KUBERNETES_TLS__SECRET: {{ .Values.global.tls.secretName | quote}}
{{- else }}
CHE_INFRA_KUBERNETES_TLS__ENABLED: "false"
CHE_INFRA_KUBERNETES_TLS__SECRET: ""
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes/helm/che/templates/dashboard-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ spec:
tls:
- hosts:
- {{ template "cheHost" . }}
{{- if .Values.global.tls.secretName }}
secretName: {{ .Values.global.tls.secretName }}
{{- end -}}
{{- end }}
rules:
{{- if ne .Values.global.serverStrategy "default-host" }}
Expand Down
3 changes: 2 additions & 1 deletion deploy/kubernetes/helm/che/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ spec:

# If workspaces are created in a separate namespace(s)
# then configure Che Server to propagate TLS secret to workspaces' namespaces
{{- if ne .Release.Namespace .Values.global.cheWorkspacesNamespace }}
# Do not propagate anything in case of using default ingress controller certificate (global.tls.secretName is empty)
{{- if and (ne .Release.Namespace .Values.global.cheWorkspacesNamespace) (.Values.global.tls.secretName) }}
- name: "CHE_INFRA_KUBERNETES_TLS__CERT"
valueFrom:
secretKeyRef:
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes/helm/che/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ spec:
tls:
- hosts:
- {{ template "cheHost" . }}
{{- if .Values.global.tls.secretName }}
secretName: {{ .Values.global.tls.secretName }}
{{- end -}}
{{- end }}
rules:
{{- if ne .Values.global.serverStrategy "default-host" }}
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes/helm/che/templates/metrics-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ spec:
- hosts:
- {{ template "prometheusHost" . }}
- {{ template "grafanaHost" . }}
{{- if .Values.global.tls.secretName }}
secretName: {{ .Values.global.tls.secretName }}
{{- end -}}
{{- end }}
rules:
- host: {{ template "prometheusHost" . }}
Expand Down
1 change: 1 addition & 0 deletions deploy/kubernetes/helm/che/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ global:
## Secret name that will be used in Che Ingresses for setting TLS up
## Note the helm chart does not create this secret and
## it MUST be pre-created in the configured Che namespace
## If the value is empty, then the certificate from default ingress controller will be used.
secretName: che-tls

## If self-signed certificate flag is enabled
Expand Down

0 comments on commit 0815cdb

Please sign in to comment.