apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: api-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
  ingressClassName: nginx
  tls:
  - hosts:
    - api.taskboard.cloud
    secretName: tls-cert
  rules:
  - host: api.taskboard.cloud
    http:
      paths:
      - path: /task(/|$)(.*)
        pathType: Exact
        backend:
          service:
            name: task-svc
            port:
              number: 80
      - path: /project(/|$)(.*)
        pathType: Exact
        backend:
          service:
            name: project-svc
            port:
              number: 80
