Browse Source

Added edemocracia.hostname parameter, easing ingress configuration

master
Fábio Kaiser Rauber 4 years ago
parent
commit
e735dd5907
  1. 2
      charts/edemocracia/v0.4.0/questions.yaml
  2. 22
      charts/edemocracia/v0.4.0/templates/ingress.yaml
  3. 13
      charts/edemocracia/v0.4.0/values.yaml

2
charts/edemocracia/v0.4.0/questions.yaml

@ -12,7 +12,7 @@ questions:
group: Básico
required: true
- variable: edemocracia.hostname
default: "sapl.teste.df.leg.br"
default: "edemocracia.teste.df.leg.br"
description: "Endereço para acesso ao E-democracia"
label: "URL do SAPL"
type: string

22
charts/edemocracia/v0.4.0/templates/ingress.yaml

@ -1,7 +1,6 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "edemocracia.fullname" . -}}
{{- $svcPort := .Values.nginx.service.port -}}
{{- $ingressPath := .Values.ingress.path -}}
{{- $hostName := .Values.edemocracia.hostname -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
@ -12,29 +11,22 @@ metadata:
name: {{ $fullName }}
labels:
{{- include "edemocracia.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
{{- with .Values.ingress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
- "{{ $hostName }}"
secretName: {{ $hostName | replace "." "-" }}-tls
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . | quote }}
- host: "{{ $hostName }}"
http:
paths:
- path: {{ $ingressPath }}
- path: /
backend:
serviceName: nginx
servicePort: http
{{- end }}
{{- end }}

13
charts/edemocracia/v0.4.0/values.yaml

@ -82,6 +82,7 @@ edemocracia:
key: ""
secret: ""
siteName: "Camara Municipal"
hostname: "edemocracia.teste.df.leg.br"
timeZone: "America/Sao_Paulo"
image:
repository: labhackercd/edemocracia
@ -174,20 +175,10 @@ imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
ingress:
enabled: true
# extra annotations only
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
path: /
hosts:
- chart-example.local
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
nodeSelector: {}

Loading…
Cancel
Save