---
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
  name: ingress-with-ssl-redirect
  namespace: default


spec:
  ingressClassName: nginx
  rules:
    - host: sslredirect.localhost
      http:
        paths:
          - path: /
            pathType: Exact
            backend:
              service:
                name: whoami
                port:
                  number: 80
  tls:
    -  hosts:
         - sslredirect.localhost
       secretName: whoami-tls

---
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
  name: ingress-without-ssl-redirect
  namespace: default
  annotations:
    nginx.ingress.kubernetes.io/ssl-redirect: "false"

spec:
  ingressClassName: nginx
  rules:
    - host: withoutsslredirect.localhost
      http:
        paths:
          - path: /
            pathType: Exact
            backend:
              service:
                name: whoami
                port:
                  number: 80
  tls:
    -  hosts:
         - withoutsslredirect.localhost
       secretName: whoami-tls

---
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
  name: ingress-with-force-ssl-redirect
  namespace: default
  annotations:
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"

spec:
  ingressClassName: nginx
  rules:
    - host: forcesslredirect.localhost
      http:
        paths:
          - path: /
            pathType: Exact
            backend:
              service:
                name: whoami
                port:
                  number: 80
