Browse Source

Added hostprefix parameter for customization

master
Fábio Kaiser Rauber 4 years ago
parent
commit
64f5462936
  1. 7
      charts/portalmodelo/v0.5.0/questions.yaml
  2. 9
      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

@ -37,6 +37,13 @@ questions:
type: string type: string
group: Básico group: Básico
required: true required: true
- variable: portal.hostprefix
default: "www"
description: "Prefixo da URL do Portal"
label: Prefixo do Host
type: string
group: Básico
required: false
- variable: portal.rootPassword - variable: portal.rootPassword
default: "altereme" default: "altereme"
description: "Senha de Admin do Zope (raiz)" description: "Senha de Admin do Zope (raiz)"

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

@ -1,6 +1,7 @@
{{- if .Values.ingress.enabled -}} {{- if .Values.ingress.enabled -}}
{{- $fullName := include "portalmodelo.fullname" . -}} {{- $fullName := include "portalmodelo.fullname" . -}}
{{- $hostName := .Values.portal.hostname -}} {{- $hostName := .Values.portal.hostname -}}
{{- $hostPrefix := .Values.portal.hostprefix -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} {{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1beta1
{{- else -}} {{- else -}}
@ -18,7 +19,7 @@ metadata:
cert-manager.io/cluster-issuer: "letsencrypt-prod" cert-manager.io/cluster-issuer: "letsencrypt-prod"
{{- end }} {{- end }}
{{- if contains "nginx" .Values.ingress.class }} {{- if contains "nginx" .Values.ingress.class }}
nginx.ingress.kubernetes.io/rewrite-target: "/VirtualHostBase/https/www.{{ $hostName }}:443/portal/VirtualHostRoot/$1" nginx.ingress.kubernetes.io/rewrite-target: "/VirtualHostBase/https/{{ $hostPrefix }}.{{ $hostName }}:443/portal/VirtualHostRoot/$1"
nginx.ingress.kubernetes.io/from-to-www-redirect: "true" nginx.ingress.kubernetes.io/from-to-www-redirect: "true"
{{- end }} {{- end }}
{{- if contains "alb" .Values.ingress.class }} {{- if contains "alb" .Values.ingress.class }}
@ -27,7 +28,7 @@ metadata:
{{- else }} {{- else }}
# DO NOT USE TLS # DO NOT USE TLS
{{- if contains "nginx" .Values.ingress.class }} {{- if contains "nginx" .Values.ingress.class }}
nginx.ingress.kubernetes.io/rewrite-target: "/VirtualHostBase/http/www.{{ $hostName }}:80/portal/VirtualHostRoot/$1" nginx.ingress.kubernetes.io/rewrite-target: "/VirtualHostBase/http/{{ $hostPrefix }}.{{ $hostName }}:80/portal/VirtualHostRoot/$1"
{{- end }} {{- end }}
{{- if contains "alb" .Values.ingress.class }} {{- if contains "alb" .Values.ingress.class }}
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]' alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]'
@ -43,12 +44,12 @@ spec:
{{- if .Values.ingress.tls.enabled }} {{- if .Values.ingress.tls.enabled }}
tls: tls:
- hosts: - hosts:
- "www.{{ $hostName }}" - "{{ $hostPrefix }}.{{ $hostName }}"
- "{{ $hostName }}" - "{{ $hostName }}"
secretName: {{ $hostName | replace "." "-" }}-tls secretName: {{ $hostName | replace "." "-" }}-tls
{{- end }} {{- end }}
rules: rules:
- host: "www.{{ $hostName }}" - host: "{{ $hostPrefix }}.{{ $hostName }}"
http: http:
paths: paths:
{{- if contains "nginx" .Values.ingress.class }} {{- if contains "nginx" .Values.ingress.class }}

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

@ -27,6 +27,7 @@ portal:
title: Câmara Municipal title: Câmara Municipal
description: Cidade - UF description: Cidade - UF
hostname: teste.df.leg.br hostname: teste.df.leg.br
hostprefix: www
timeZone: America/Sao_Paulo timeZone: America/Sao_Paulo
createAndUpgrade: true createAndUpgrade: true

Loading…
Cancel
Save