apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: knck-ingress
  annotations:
    traefik.ingress.kubernetes.io/router.entrypoints: websecure
    traefik.ingress.kubernetes.io/router.tls: "true"
    traefik.ingress.kubernetes.io/router.middlewares: default-redirect-https@kubernetescrd
    traefik.ingress.kubernetes.io/service.serversscheme: http
    traefik.ingress.kubernetes.io/service.passhostheader: "true"
    traefik.ingress.kubernetes.io/router.priority: "1"
    cert-manager.io/cluster-issuer: letsencrypt-prod
    acme.cert-manager.io/http01-edit-in-place: "true"
    acme.cert-manager.io/http01-ingress-class: traefik
spec:
  tls:
  - hosts:
    - knck.pl
    - api.knck.pl
    secretName: knck-tls
  rules:
  - host: knck.pl
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: knck-app
            port:
              number: 80
  - host: api.knck.pl
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: knck-app
            port:
              number: 3001 