kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
  name:  ingress-{{ .Release.Name }}-webapp
  labels:
    app.kubernetes.io/name:	"{{ .Chart.Name }}"
    app.kubernetes.io/instance:	"{{ .Release.Name }}"
    app.kubernetes.io/version: "{{ .Chart.AppVersion }}"
    app.kubernetes.io/component: "ingress webapp"
    app.kubernetes.io/part-of:	"{{ .Chart.Name }}"
    app.kubernetes.io/managed-by: "{{ .Release.Service }}"
    helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
  annotations:
    kubernetes.io/ingress.class: "nginx"
    cert-manager.io/cluster-issuer: {{ .Values.LETSENCRYPT.ISSUER }}
    nginx.ingress.kubernetes.io/proxy-body-size: {{ .Values.NGINX.PROXY_BODY_SIZE }}
spec:
  tls:
    - hosts:
      - {{ .Values.LETSENCRYPT.DOMAIN }}
      secretName: tls
  rules:
    - host: {{ .Values.LETSENCRYPT.DOMAIN }}
      http:
        paths:
          - path: /
            pathType: ImplementationSpecific
            backend:
              service:
                name: {{ .Release.Name }}-webapp
                port:
                  number: 3000

#{{- if .Values.developmentMailserverDomain }}
#    - host: {{ .Values.developmentMailserverDomain }}
#      http:
#        paths:
#        - path: /
#          backend:
#            serviceName: {{ .Release.Name }}-mailserver
#            servicePort: 80
#{{- end }}
