# apiVersion: networking.k8s.io/v1beta1 # for k3s < v1.19
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: myserver
  annotations:
    kubernetes.io/ingress.class: nginx
    ingress.kubernetes.io/ssl-redirect: "false"
    cert-manager.io/cluster-issuer: letsencrypt-production
spec:
  rules:
    - host: web.kube.5570w.rconway.uk
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: myserver
                port:
                  number: 80
  tls: # < placing a host in the TLS config will determine what ends up in the cert's subjectAltNames
    - hosts:
        - web.kube.5570w.rconway.uk
      secretName: myserver-tls # < cert-manager will store the created certificate in this secret.
