YAML syntax for default 'route' to catch all domains?

I'm trying to use Cloudflare for SaaS to have a bunch of custom domains point to my webapp.

This works fine for wildcard subdomains of my root domain, but I realized that I need a default route to use the custom domains.

I've been reading the docs but can't seem to figure out the right syntax to achieve this:

I'm running on k3s so using the pre-installed traefik with this ingress config:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress
  namespace: prod
  annotations:
    traefik.ingress.kubernetes.io/router.entrypoints: websecure
    traefik.ingress.kubernetes.io/router.tls: "true"
spec:
  rules:
    - host: mydomain.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: webapp-service
                port:
                  number: 3000
    - host: HostRegexp(`{catchall:.*}`)
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: webapp-service
                port:
                  number: 3000
  tls:
    - hosts:
        - "mydomain.com
      secretName: cloudflare-cert
     - hosts:
         - "*"
      secretName: cloudflare-cert

This has been recommended by a maintainer (post):

HostRegexp(`.+`)

Make sure to use Traefik v3.

Note that the rule may be longer than domain only, at least in Docker rules are prioritized by length. So you might need to set a lower priority (number), for catchall to be matched last.

Ah I just checked and have to use traefik v2 unfortunately. I selected the wrong tag :frowning:

Unfortunately k3s doesn't support v3 yet judging by a long-lived github issue, based on what I read there I wouldn't risk upgrading just yet.

Any chance you know how to modify this for the v2?

Interesting that the chart still uses v2 (issue).

Your config looks okay, is it not working? Check if you can add a priority per router.