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 group: Básico
required: true required: true
- variable: edemocracia.hostname - variable: edemocracia.hostname
default: "sapl.teste.df.leg.br" default: "edemocracia.teste.df.leg.br"
description: "Endereço para acesso ao E-democracia" description: "Endereço para acesso ao E-democracia"
label: "URL do SAPL" label: "URL do SAPL"
type: string type: string

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

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

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

@ -82,6 +82,7 @@ edemocracia:
key: "" key: ""
secret: "" secret: ""
siteName: "Camara Municipal" siteName: "Camara Municipal"
hostname: "edemocracia.teste.df.leg.br"
timeZone: "America/Sao_Paulo" timeZone: "America/Sao_Paulo"
image: image:
repository: labhackercd/edemocracia repository: labhackercd/edemocracia
@ -174,20 +175,10 @@ imagePullSecrets: []
nameOverride: "" nameOverride: ""
fullnameOverride: "" fullnameOverride: ""
ingress: ingress:
enabled: true enabled: true
# extra annotations only
annotations: {} 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: {} nodeSelector: {}

Loading…
Cancel
Save