apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: mailhog
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/auth-url: "https://$host/oauth2/auth"
    nginx.ingress.kubernetes.io/auth-signin: "https://$host/oauth2/start?rd=$request_uri"
spec:
  rules:
  - host: "mailhog.eni.yannig.ovh"
    http:
      paths:
      - path: /
        backend:
          serviceName: mailhog
          servicePort: 8025
  tls:
    - secretName: eni-yannig-ovh-prod-tls
      hosts:
        - "mailhog.eni.yannig.ovh"

---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: mailhog-oauth2-proxy
  namespace: nginx-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    kubernetes.io/tls-acme: "true"
spec:
  rules:
    - host: "mailhog.eni.yannig.ovh"
      http:
        paths:
        - backend:
            serviceName: authproxy-oauth2-proxy
            servicePort: 80
          path: /oauth2
  tls:
    - hosts:
        - "mailhog.eni.yannig.ovh"
