K8S ingress rule fails to match Exact / #10631
Labels
kind/bug
Categorizes issue or PR as related to a bug.
lifecycle/frozen
Indicates that an issue or PR should not be auto-closed due to staleness.
needs-priority
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
Using Pattern to catch Exact /:
│app.kubernetes.io/name: rke2-ingress-nginx │app.kubernetes.io/version: 1.6.4 │helm.sh/chart: rke2-ingress-nginx-4.5.201
Having an ingress with:
│ rules:
│ - http:
│ paths:
│ - backend:
│ service:
│ name: powerflex-status-ui
│ port:
│ number: 80
│ path: /
│ pathType: Exact
When calling:
curl -k -H 'Cache-Control: no-cache, no-store' -I https://100.68.80.54/
HTTP/2 404
It should have returned 200 - it fails to match a single /
It worked with an older version. We have a workaround, adding $ to the expression.
WORKAROUND: That one seems identical but it works - getting http 200 by using: Exact /$
│ rules:
│ - http:
│ paths:
│ - backend:
│ service:
│ name: powerflex-status-ui
│ port:
│ number: 80
│ path: /$
│ pathType: Exact
** Expected 200 **:
The parsing with Exact is not good - a minor bug and we have a workaround by changing the expression:
/$
It should behave the same with \ vs. $
NGINX Ingress controller version (exec into the pod and run nginx-ingress-controller --version.):
NGINX Ingress controller
Release: nginx-1.6.4-hardened4
Build: git-90e1717ce
Repository: https://github.com/rancher/ingress-nginx.git
nginx version: nginx/1.21.4
Kubernetes version (use
kubectl version
):1.26.4+rke2r1
Environment:
Install tools:
Please mention how/where was the cluster created like kubeadm/kops/minikube/kind etc.
Basic cluster related info:
kubectl version
kubectl get nodes -o wide
helm ls -A | grep -i ingress
/label rke2
The text was updated successfully, but these errors were encountered: