404 on some ingress route

I have a cluster that has few namespaces and on each namespace, I have an application deployed that is exposed using an ingress route. I'm able to connect to some applications but not others which gave me a 404. Notice that its the same helm chart so there is no actual variation of the resource besides the namespace and the domain. Traefik was deployed using the helm chart and its on version 2.5.1 below its an example of the ingress routes

this one works

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: myname
  namespace: namespace1
spec:
  entryPoints:
    - websecure
  routes:
    - kind: Rule
      match: Host(`mydomain1`)
      middlewares:
        - name: ratelimit
          namespace: namespace1
        - name: inflightreq
          namespace: namespace1
      services:
        - name: service
          port: 80
  tls:
    secretName: cert

this one gave 404

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: myname
  namespace: namespace2
spec:
  entryPoints:
    - websecure
  routes:
    - kind: Rule
      match: Host(`mydomain2`)
      middlewares:
        - name: ratelimit
          namespace: namespace2
        - name: inflightreq
          namespace: namespace2
      services:
        - name: service
          port: 80
  tls:
    secretName: cert

traefik was deployed as a deployment with a 2 pods configuration and hpa enabled

any idea please.

Hello @bitgandtter

Thank you for using Traefik and asking the question here.

I think the issue is related to allowCrossNamespace which should be set to true if you use resources created in the different namespaces.

Please, see the docs: Kubernetes IngressRoute - Traefik