You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.7 KiB
58 lines
1.7 KiB
3 years ago
|
{{- if .Values.ingress.enabled -}}
|
||
|
{{- $fullName := include "sigi.fullname" . -}}
|
||
|
{{- $hostName := .Values.sigi.hostname -}}
|
||
|
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||
|
apiVersion: networking.k8s.io/v1beta1
|
||
|
{{- else -}}
|
||
|
apiVersion: extensions/v1beta1
|
||
|
{{- end }}
|
||
|
kind: Ingress
|
||
|
metadata:
|
||
|
name: {{ $fullName }}
|
||
|
labels:
|
||
|
{{- include "sigi.labels" . | nindent 4 }}
|
||
|
annotations:
|
||
|
{{- if .Values.ingress.tls.enabled }}
|
||
|
# USE TLS
|
||
|
{{- if contains "letsencrypt" .Values.ingress.tls.provider }}
|
||
|
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: sigi
|
||
|
alb.ingress.kubernetes.io/scheme: internet-facing
|
||
|
alb.ingress.kubernetes.io/target-type: ip
|
||
|
kubernetes.io/ingress.class: alb
|
||
|
{{- end }}
|
||
|
{{- with .Values.ingress.annotations }}
|
||
|
{{- toYaml . | nindent 4 }}
|
||
|
{{- end }}
|
||
|
spec:
|
||
|
{{- if .Values.ingress.tls.enabled }}
|
||
|
tls:
|
||
|
- hosts:
|
||
|
- "{{ $hostName }}"
|
||
|
secretName: {{ $hostName | replace "." "-" }}-tls
|
||
|
{{- end }}
|
||
|
rules:
|
||
|
- host: "{{ $hostName }}"
|
||
|
http:
|
||
|
paths:
|
||
|
{{- if contains "nginx" .Values.ingress.class }}
|
||
|
- path: /
|
||
|
{{- else }}
|
||
|
- path: /*
|
||
|
{{- end }}
|
||
|
backend:
|
||
|
serviceName: {{ $fullName }}
|
||
|
servicePort: http
|
||
|
{{- end }}
|