Outdated rewrite-target rule in example yaml
izderadicka opened this issue · comments
This is a Bug Report
Problem:
The example Ingress contains rewrite annotation:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
But with new ingress 0.22 + capture groups must be explicit, see https://github.com/kubernetes/ingress-nginx/blob/main/docs/examples/rewrite/README.md
As result this example rewrites all paths with / - it does work for simple example, but it breaks any more complex web service!
So if some body uses it as template and edits it for his own use case, can get into trouble, which are bit tricky to detect.
Proposed Solution:
Just delete rewrite-target annotation and ingress will work as expect by default.
Page to Update:
https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/
issue page: https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/
/language en
Starting in Version 0.22.0, ingress definitions using the annotation nginx.ingress.kubernetes.io/rewrite-target are not backwards compatible with previous versions. In Version 0.22.0 and beyond, any substrings within the request URI that need to be passed to the rewritten path must explicitly be defined in a capture group.
As this is simple ingress example so no rewrite example is needed
/triage accepted