---
# Redirect {{ REDIRECT_SUBDOMAIN }} to non-{{ REDIRECT_SUBDOMAIN }}
# by tutor-contrib-redirect
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: {{ REDIRECT_SUBDOMAIN }}-{{ LMS_HOST | replace(".", "-") }}-redirect
  namespace: {{ K8S_NAMESPACE }}
  labels:
    app.kubernetes.io/component: ingress
  annotations:
    cert-manager.io/cluster-issuer: harmony-letsencrypt-global
    nginx.ingress.kubernetes.io/permanent-redirect: "https://{{ LMS_HOST }}"
    nginx.ingress.kubernetes.io/permanent-redirect-code: "308"
spec:
  ingressClassName: nginx
  rules:
  - host: "{{ REDIRECT_SUBDOMAIN }}.{{ LMS_HOST }}"
  tls:
  - hosts:
    - {{ REDIRECT_SUBDOMAIN }}.{{ LMS_HOST }}
    secretName: {{ REDIRECT_SUBDOMAIN }}-{{ LMS_HOST | replace(".", "-") }}-tls

# End of tutor-contrib-redirect patch
