apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: apiserver
  namespace: kube-system
  annotations:
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
    nginx.ingress.kubernetes.io/cors-allow-credentials: "true"
    nginx.ingress.kubernetes.io/cors-allow-headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization
    nginx.ingress.kubernetes.io/cors-allow-methods: PUT, GET, POST, OPTIONS, DELETE, PATCH
    nginx.ingress.kubernetes.io/cors-allow-origin: https://*
    nginx.ingress.kubernetes.io/enable-cors: "true"
    nginx.ingress.kubernetes.io/proxy-connect-timeout: "600"
    nginx.ingress.kubernetes.io/custom-http-errors: "418"
    nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
    cert-manager.io/cluster-issuer: letsencrypt-production
spec:
  ingressClassName: nginx-external
  rules:
  - host: apiserver.crownlabs.polito.it
    http:
      paths:
      - backend:
          service:
            name: apiserver
            port:
              number: 6443
        path: /
        pathType: Prefix
  tls:
  - hosts:
    - apiserver.crownlabs.polito.it
    secretName: apiserver-ingress-cert
