Mayur Sharma:
Hi , I was attempting the INgress Networking lab, last question where it asked to write an ingress and use following annotation,
annotations:
http://nginx.ingress.kubernetes.io/rewrite-target|nginx.ingress.kubernetes.io/rewrite-target: /
It worked with this annotation and when I removed this annotation and apply the ingress, URL did not work.
Working Ingress Resource
apiVersion: http://networking.k8s.io/v1|networking.k8s.io/v1
kind: Ingress
metadata:
name: simple-fanout-example
namespace: critical-space
annotations:
http://nginx.ingress.kubernetes.io/rewrite-target|nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:- path: /pay
pathType: Prefix
backend:
service:
name: pay-service
port:
number: 8282
- path: /pay
Can someone please help me to understand why it is working with annotation and failed when we remove the annotation