From 7a13c545586da5db06684e2d8fbb897699ba5894 Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Mon, 14 Dec 2020 16:20:00 -0300 Subject: [PATCH] Added ingress.tls parameter, to enable or disable tls --- charts/portalmodelo/v0.5.0/questions.yaml | 9 +++++++++ charts/portalmodelo/v0.5.0/templates/ingress.yaml | 4 ++++ charts/portalmodelo/v0.5.0/values.yaml | 1 + 3 files changed, 14 insertions(+) diff --git a/charts/portalmodelo/v0.5.0/questions.yaml b/charts/portalmodelo/v0.5.0/questions.yaml index e4d6262..f9e2bb4 100644 --- a/charts/portalmodelo/v0.5.0/questions.yaml +++ b/charts/portalmodelo/v0.5.0/questions.yaml @@ -52,6 +52,15 @@ questions: group: Básico required: true +# Ingress +- variable: ingress.tls + default: true + type: boolean + description: "Habilitar criptografia do protocolo HTTP (HTTPS)?" + label: "Habilitar TLS?" + required: false + group: Ingress + # Configurações Avançadas - variable: portal.timeZone default: "America/Sao_Paulo" diff --git a/charts/portalmodelo/v0.5.0/templates/ingress.yaml b/charts/portalmodelo/v0.5.0/templates/ingress.yaml index be8c5dc..6f83027 100644 --- a/charts/portalmodelo/v0.5.0/templates/ingress.yaml +++ b/charts/portalmodelo/v0.5.0/templates/ingress.yaml @@ -12,15 +12,19 @@ metadata: labels: {{- include "portalmodelo.labels" . | nindent 4 }} annotations: + {{- if .Values.ingress.tls -}} cert-manager.io/cluster-issuer: "letsencrypt-prod" nginx.ingress.kubernetes.io/rewrite-target: "/VirtualHostBase/https/www.{{ $hostName }}:443/portal/VirtualHostRoot/$1" nginx.ingress.kubernetes.io/from-to-www-redirect: "true" + {{- end}} spec: + {{- if .Values.ingress.tls -}} tls: - hosts: - "www.{{ $hostName }}" - "{{ $hostName }}" secretName: {{ $hostName | replace "." "-" }}-tls + {{- end -}} rules: - host: "www.{{ $hostName }}" http: diff --git a/charts/portalmodelo/v0.5.0/values.yaml b/charts/portalmodelo/v0.5.0/values.yaml index 4f842ea..eb58f7c 100644 --- a/charts/portalmodelo/v0.5.0/values.yaml +++ b/charts/portalmodelo/v0.5.0/values.yaml @@ -53,6 +53,7 @@ securityContext: {} ingress: enabled: true + tls: true # extra annotations only annotations: {}