The CKS and CKA courses have an article on ingress annotations, “Ingress - Annotations and rewrite-target”. The article is incomplete because apps’ URLs are incomplete and URL for nginx ingress examples are missing. Therefore, the article is really hard to understand.
I’m not sure what you don’t understand here, although the annotation is itself a bit hard to handstand.
An ingress resource is creating path you use to create access to the pods pointed to by the services you use in setting up the rules of the ingress. In the article, the actual services for wear and watch know how to display a page, but they only know about the path “/” in both cases. If you send them any other path, the web servers implemented in the pods will return a “not found” 404 error.
But if you use the ingress resource from the example without the rewrite annotation, you’re using URLs like. HOST/wear for the wear service, and HOST/watch for the video service, and for wear, that /wear path will be sent all the way to the pod. The pod only knows about “/”; you won’t get the page you want. You’ll get a 404 page instead.
The /wear path is in the HTTP request itself. So how do you fix that? The annotation does that; it takes the HTTP request, and changes the header that has the /wear path to “/”. So the user uses /wear. but the pod sees /, and we get the correct page. This is what the annotation does.
Oh I do understand (I just passed CKA a few days ago , all thanks to KodeKloud - where is that jumping-up-and-down smiley when you need it?). I was reporting an issue in the content, to which I also posted a thread in the CKA category (with the link), because I found the same issue in both CKA and CKS courses.