apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: kube-dashboard
  namespace: kube-system    # namespace must be the same as the backend service!
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$1
    cert-manager.io/cluster-issuer: letsencrypt
    nginx.ingress.kubernetes.io/backend-protocol: HTTPS
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
  rules:
  - host: dev.imicros.de # CHANGE ME!
    http:
      paths:
      - path: /kube/(.*)
        pathType: Prefix
        backend:
          service:
            name: kubernetes-dashboard
            port:
              number: 8443
  tls: # < placing a host in the TLS config will determine what ends up in the cert's subjectAltNames
  - hosts:
    - dev.imicros.de
    secretName: imicros-cert # < cert-manager will store the created certificate in this secret.              
