From 59e721a4b189d1ebf1626157079965031eb1f22c Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Mon, 14 Feb 2022 11:51:58 -0300 Subject: [PATCH] Created Ingress objects for pop and smtp --- .../v1.4.0/templates/pop-ingress.yaml | 40 +++++++++++++++++++ .../v1.4.0/templates/smtp-ingress.yaml | 40 +++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100755 charts/emailleg/v1.4.0/templates/pop-ingress.yaml create mode 100755 charts/emailleg/v1.4.0/templates/smtp-ingress.yaml diff --git a/charts/emailleg/v1.4.0/templates/pop-ingress.yaml b/charts/emailleg/v1.4.0/templates/pop-ingress.yaml new file mode 100755 index 0000000..055b084 --- /dev/null +++ b/charts/emailleg/v1.4.0/templates/pop-ingress.yaml @@ -0,0 +1,40 @@ +{{- $fullName := include "emailleg.fullname" . -}} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ .Release.Name }}-pop + labels: + {{- include "emailleg.labels" . | nindent 4 }} + annotations: + cert-manager.io/cluster-issuer: letsencrypt-prod + ingress.kubernetes.io/tcp-service-port: "995" + kubernetes.io/ingress.class: haproxy +spec: + tls: + - hosts: + - "pop.{{ .Values.mail.domain }}" + secretName: {{ .Release.Name }}-pop-crt + rules: + - host: "pop.{{ .Values.mail.domain }}" + http: + paths: + - path: {{ .path }} + {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} + pathType: ImplementationSpecific + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ .Release.Name }}-mail + port: + number: 110 + {{- else }} + serviceName: {{ .Release.Name }}-mail + servicePort: pop + {{- end }} diff --git a/charts/emailleg/v1.4.0/templates/smtp-ingress.yaml b/charts/emailleg/v1.4.0/templates/smtp-ingress.yaml new file mode 100755 index 0000000..26182f0 --- /dev/null +++ b/charts/emailleg/v1.4.0/templates/smtp-ingress.yaml @@ -0,0 +1,40 @@ +{{- $fullName := include "emailleg.fullname" . -}} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ .Release.Name }}-smtp + labels: + {{- include "emailleg.labels" . | nindent 4 }} + annotations: + cert-manager.io/cluster-issuer: letsencrypt-prod + ingress.kubernetes.io/tcp-service-port: "587" + kubernetes.io/ingress.class: haproxy +spec: + tls: + - hosts: + - "imap.{{ .Values.mail.domain }}" + secretName: {{ .Release.Name }}-smtp-crt + rules: + - host: "imap.{{ .Values.mail.domain }}" + http: + paths: + - path: {{ .path }} + {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} + pathType: ImplementationSpecific + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ .Release.Name }}-mail + port: + number: 25 + {{- else }} + serviceName: {{ .Release.Name }}-mail + servicePort: smtp + {{- end }}