Browse Source

Added ALB Ingress option to SAPL chart

master
Fábio Kaiser Rauber 4 years ago
parent
commit
6c420ee4c7
  1. 32
      charts/sapl/v0.2.0/questions.yaml
  2. 27
      charts/sapl/v0.2.0/templates/ingress.yaml
  3. 6
      charts/sapl/v0.2.0/values.yaml

32
charts/sapl/v0.2.0/questions.yaml

@ -26,6 +26,38 @@ questions:
group: Básico group: Básico
required: true required: true
# Ingress
- 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
- variable: ingress.class
default: nginx
type: enum
description: "Qual o Ingress Controller?"
label: "Classe Ingress"
required: false
group: Ingress
options:
- nginx
- alb
# Correio # Correio
- variable: sapl.emailSendUser - variable: sapl.emailSendUser
default: "no-reply@interlegis.leg.br" default: "no-reply@interlegis.leg.br"

27
charts/sapl/v0.2.0/templates/ingress.yaml

@ -12,20 +12,45 @@ metadata:
labels: labels:
{{- include "sapl.labels" . | nindent 4 }} {{- include "sapl.labels" . | nindent 4 }}
annotations: annotations:
{{- if .Values.ingress.tls.enabled }}
# USE TLS
{{- if contains "letsencrypt" .Values.ingress.tls.provider }}
cert-manager.io/cluster-issuer: "letsencrypt-prod" cert-manager.io/cluster-issuer: "letsencrypt-prod"
{{- end }}
{{- if contains "alb" .Values.ingress.class }}
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
{{- end }}
{{- else }}
# DO NOT USE TLS
{{- if contains "alb" .Values.ingress.class }}
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]'
{{- end }}
{{- end }}
{{- if contains "alb" .Values.ingress.class }}
alb.ingress.kubernetes.io/group.name: sapl
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
kubernetes.io/ingress.class: alb
{{- end }}
{{- with .Values.ingress.annotations }} {{- with .Values.ingress.annotations }}
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
spec: spec:
{{- if .Values.ingress.tls.enabled }}
tls: tls:
- hosts: - hosts:
- "{{ $hostName }}" - "{{ $hostName }}"
secretName: {{ $hostName | replace "." "-" }}-tls secretName: {{ $hostName | replace "." "-" }}-tls
{{- end }}
rules: rules:
- host: "{{ $hostName }}" - host: "{{ $hostName }}"
http: http:
paths: paths:
- path: / {{- if contains "nginx" .Values.ingress.class }}
- path: /(.*)
{{- else }}
- path: /*
{{- end }}
backend: backend:
serviceName: {{ $fullName }} serviceName: {{ $fullName }}
servicePort: http servicePort: http

6
charts/sapl/v0.2.0/values.yaml

@ -65,6 +65,12 @@ sapl:
ingress: ingress:
enabled: true enabled: true
class: nginx
# nginx - for default nginx ingress controller
# alb - for AWS ALB Load Balancer controller
tls:
enabled: true
provider: letsencrypt
# extra annotations only # extra annotations only
annotations: {} annotations: {}

Loading…
Cancel
Save