apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: team-planner-ingress
  annotations:
    traefik.ingress.kubernetes.io/router.entrypoints: websecure
    traefik.ingress.kubernetes.io/router.tls: "true"
spec:
  ingressClassName: traefik
  tls:
  - hosts:
    - __HOSTNAME__
    secretName: __SECRET_NAME__
  rules:
  - host: __HOSTNAME__
    http:
      paths:
      # Backend API routes
      - path: /api
        pathType: Prefix
        backend:
          service:
            name: team-planner-backend-service
            port:
              number: 4001
      # Frontend routes (all other paths)
      - path: /
        pathType: Prefix
        backend:
          service:
            name: team-planner-frontend-service
            port:
              number: 80
