I would like to apply HostRegExp with Traefik as ingress Controller. I have something similar like below with docker as provider in Traefik service.
"traefik.http.routers.test.rule=HostRegexp(`{host:.+}`) && PathPrefix(`/test`)"
Would like to replicate similar stuff in Kubernetes.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: test-service
annotations:
#kubernetes.io/ingress.class: traefik
# entryPoints Configuration
traefik.ingress.kubernetes.io/router.entrypoints: web,websecure
traefik.ingress.kubernetes.io/router.tls: "true"
#configuring rules
#traefik.frontend.rule.type: HostRegexp
spec:
rules:
- host: `{host:.+}`
http:
paths:
- path: /rmq
pathType: Prefix
backend:
service:
name: rabbitmq
port:
name: http
Tried below options. Any inputs ?
I don't know if this functionality is exposed through the
Ingress
provider, but you can do it using anIngressRoute
resource. For example, if I have:Then I can access the service using the hostnames like:
foo.using.ingressroute
foobar.using.ingressroute
foo.one.two.three.using.ingressroute