apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: {{ .Release.Name }}-internal-tls
  annotations:
    kubernetes.io/ingress.class: traefik-internal
spec:
  entryPoints:
    - websecure
  tls:
    certResolver: myresolver
    domains:
    - main: "*.ducoterra.net"
  routes:
  - match: Host(`{{ .Release.Name }}.ducoterra.net`)
    kind: Rule
    services:
    - name: {{ .Release.Name }}
      port: {{ .Values.port }}

---

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: {{ .Release.Name }}-internal-web
  annotations:
    kubernetes.io/ingress.class: traefik-internal
spec:
  entryPoints:
    - web
  routes:
  - match: Host(`{{ .Release.Name }}.ducoterra.net`)
    kind: Rule
    services:
    - name: {{ .Release.Name }}
      port: {{ .Values.port }}
    middlewares:
      - name: httpsredirect

---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: {{ .Release.Name }}-external-tls
  annotations:
    kubernetes.io/ingress.class: traefik-external
spec:
  entryPoints:
    - websecure
  tls:
    certResolver: myresolver
  routes:
  - match: Host(`{{ .Release.Name }}.ducoterra.net`)
    kind: Rule
    services:
    - name: {{ .Release.Name }}
      port: {{ .Values.port }}

---

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: {{ .Release.Name }}-external-web
  annotations:
    kubernetes.io/ingress.class: traefik-external
spec:
  entryPoints:
    - web
  routes:
  - match: Host(`{{ .Release.Name }}.ducoterra.net`)
    kind: Rule
    services:
    - name: {{ .Release.Name }}
      port: {{ .Values.port }}
    middlewares:
      - name: httpsredirect
