I'm using Traefik v1.7 and Kubernetes 1.17.
I have a k8s service that has a /customers
resource that will return all customers. It can also return a specific customer at /customers/1
.
I've configured Traefik ingress as follows:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
traefik.frontend.rule.type: PathPrefix
name: customerd
namespace: video
spec:
rules:
- host: custd.kube
http:
paths:
- backend:
serviceName: customerd
servicePort: http
path: /customers
Note that the following annotation is present: traefik.frontend.rule.type: PathPrefix
. From the Traefik documentation:
Use a * Prefix * matcher if your backend listens on a particular base path but also serves requests on sub-paths. For instance, PathPrefix: /products would match /products but also /products/shoes and /products/shirts. Since the path is forwarded as-is, your backend is expected to listen on /products.
The issue is that when I submit a request to /customers/1
the response is a 404
. I've confirmed that the request doesn't reach the service. If I change PathPrefix
to PathPrefixStrip
requests to /customers
return a 404, as expected, since the service isn't listening on /
. So it seems like I'm using the annotation correctly.
Any ideas what I'm doing wrong or further troubleshooting steps?
comment