Browse Source

Improved TLS annotations handling

master
Fábio Kaiser Rauber 4 years ago
parent
commit
21d1f50747
  1. 14
      charts/portalmodelo/v0.5.0/questions.yaml
  2. 2
      charts/portalmodelo/v0.5.0/templates/NOTES.txt
  3. 8
      charts/portalmodelo/v0.5.0/templates/ingress.yaml
  4. 4
      charts/portalmodelo/v0.5.0/values.yaml

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

@ -53,13 +53,25 @@ questions:
required: true
# Ingress
- variable: ingress.tls
- variable: ingress.tls.enabled
default: true
type: boolean
description: "Habilitar criptografia do protocolo HTTP (HTTPS)?"
label: "Habilitar TLS?"
required: false
group: Ingress
show_subquestion_if: true
subquestions:
- variable: ingress.tls.provider
default: letsencrypt
type: enum
description: "Qual provedor de certificados utilizar?"
label: "Provedor de certificados"
required: false
group: Ingress
options:
- letsencrypt
- aws
# Configurações Avançadas
- variable: portal.timeZone

2
charts/portalmodelo/v0.5.0/templates/NOTES.txt

@ -1,7 +1,7 @@
1. Seu Portal Modelo pode ser acessado através da URL:
{{- if .Values.ingress.enabled }}
{{- range .Values.ingress.hosts }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}
http{{ if $.Values.ingress.tls.enabled }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "portalmodelo.fullname" . }})

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

@ -12,13 +12,15 @@ metadata:
labels:
{{- include "portalmodelo.labels" . | nindent 4 }}
annotations:
{{- if .Values.ingress.tls }}
{{- if .Values.ingress.tls.enabled }}
{{- if contains "letsencrypt" .Values.ingress.tls.provider }}
cert-manager.io/cluster-issuer: "letsencrypt-prod"
{{- end }}
nginx.ingress.kubernetes.io/rewrite-target: "/VirtualHostBase/https/www.{{ $hostName }}:443/portal/VirtualHostRoot/$1"
nginx.ingress.kubernetes.io/from-to-www-redirect: "true"
{{- end }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
{{- if .Values.ingress.tls.enabled }}
tls:
- hosts:
- "www.{{ $hostName }}"

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

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

Loading…
Cancel
Save