Browse Source

Added ingress.tls parameter, to enable or disable tls

master
Fábio Kaiser Rauber 4 years ago
parent
commit
7a13c54558
  1. 9
      charts/portalmodelo/v0.5.0/questions.yaml
  2. 4
      charts/portalmodelo/v0.5.0/templates/ingress.yaml
  3. 1
      charts/portalmodelo/v0.5.0/values.yaml

9
charts/portalmodelo/v0.5.0/questions.yaml

@ -52,6 +52,15 @@ questions:
group: Básico group: Básico
required: true 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 # Configurações Avançadas
- variable: portal.timeZone - variable: portal.timeZone
default: "America/Sao_Paulo" default: "America/Sao_Paulo"

4
charts/portalmodelo/v0.5.0/templates/ingress.yaml

@ -12,15 +12,19 @@ metadata:
labels: labels:
{{- include "portalmodelo.labels" . | nindent 4 }} {{- include "portalmodelo.labels" . | nindent 4 }}
annotations: annotations:
{{- if .Values.ingress.tls -}}
cert-manager.io/cluster-issuer: "letsencrypt-prod" 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/rewrite-target: "/VirtualHostBase/https/www.{{ $hostName }}:443/portal/VirtualHostRoot/$1"
nginx.ingress.kubernetes.io/from-to-www-redirect: "true" nginx.ingress.kubernetes.io/from-to-www-redirect: "true"
{{- end}}
spec: spec:
{{- if .Values.ingress.tls -}}
tls: tls:
- hosts: - hosts:
- "www.{{ $hostName }}" - "www.{{ $hostName }}"
- "{{ $hostName }}" - "{{ $hostName }}"
secretName: {{ $hostName | replace "." "-" }}-tls secretName: {{ $hostName | replace "." "-" }}-tls
{{- end -}}
rules: rules:
- host: "www.{{ $hostName }}" - host: "www.{{ $hostName }}"
http: http:

1
charts/portalmodelo/v0.5.0/values.yaml

@ -53,6 +53,7 @@ securityContext: {}
ingress: ingress:
enabled: true enabled: true
tls: true
# extra annotations only # extra annotations only
annotations: {} annotations: {}

Loading…
Cancel
Save