From 9a55885a1d12411bdaf391006b5ce6706fd628df Mon Sep 17 00:00:00 2001 From: Mans Ziesel Date: Sun, 22 Sep 2024 14:21:05 +0200 Subject: [PATCH] strip /ip prefix for ip listner middleware test --- ip-mziesel-nl/base/ip-mziesel-nl-ingress.yaml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ip-mziesel-nl/base/ip-mziesel-nl-ingress.yaml b/ip-mziesel-nl/base/ip-mziesel-nl-ingress.yaml index 2d4c128..31123af 100644 --- a/ip-mziesel-nl/base/ip-mziesel-nl-ingress.yaml +++ b/ip-mziesel-nl/base/ip-mziesel-nl-ingress.yaml @@ -3,15 +3,25 @@ kind: Ingress metadata: name: ip-mzisel-nl-ingress annotations: - nginx.ingress.kubernetes.io/rewrite-target: /$2 + traefik.ingress.kubernetes.io/middlewares: default-strip-ip-prefix@kubernetescrd spec: rules: - http: paths: - - path: /ip(/|$)(.*) + - path: /ip pathType: Prefix backend: service: name: ip-mziesel-nl port: name: web +--- +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: strip-ip-prefix +spec: + stripPrefix: + prefixes: + - "/ip" + forceSlash: false