Browse Source

Implemented new addprefix parameter for ingress

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

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

@ -44,6 +44,13 @@ questions:
type: string
group: Básico
required: false
- variable: portal.addprefix
default: ""
description: "Prefixo adicional para a URL do Portal (opcional)"
label: Prefixo adicional do Host
type: string
group: Básico
required: false
- variable: portal.rootPassword
default: "altereme"
description: "Senha de Admin do Zope (raiz, imutável)"

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

@ -2,6 +2,7 @@
{{- $fullName := include "portalmodelo.fullname" . -}}
{{- $hostName := .Values.portal.hostname -}}
{{- $hostPrefix := .Values.portal.hostprefix -}}
{{- $addPrefix := .Values.portal.addprefix -}}
{{- $zopeFolder := .Values.portal.zopefolder -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
@ -53,6 +54,9 @@ spec:
- hosts:
- "{{ $hostPrefix }}.{{ $hostName }}"
- "{{ $hostName }}"
{{- if .Values.portal.addprefix }}
- "{{ $addPrefix }}.{{ $hostName }}"
{{- end }}
secretName: {{ $hostName | replace "." "-" }}-tls
{{- end }}
rules:
@ -77,4 +81,27 @@ spec:
backend:
serviceName: {{ $fullName }}-plone
servicePort: 8080
{{- if .Values.portal.addprefix }}
- host: "{{ $addPrefix }}.{{ $hostName }}"
http:
paths:
{{- if and (contains "alb" .Values.ingress.class) (.Values.ingress.tls.enabled) }}
- path: /*
backend:
serviceName: ssl-redirect
servicePort: use-annotation
{{- end }}
{{- if contains "nginx" .Values.ingress.class }}
{{- if .Values.ingress.vhostmonster }}
- path: /(.*)
{{- else }}
- path: /
{{- end }}
{{- else }}
- path: /*
{{- end }}
backend:
serviceName: {{ $fullName }}-plone
servicePort: 8080
{{- end }}
{{- end }}

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

@ -40,6 +40,7 @@ portal:
description: Cidade - UF
hostname: teste.df.leg.br
hostprefix: www
addprefix: ''
timeZone: America/Sao_Paulo
createAndUpgrade: true
zopefolder: '/'

Loading…
Cancel
Save