I am a bit confused on how to go about this specific task: create an ingress rule that routes requests coming from a URI containing “/abc/def” to “http/get” if the method of the request is GET or “http/post” if the method is POST.
I have been reading about KongIngress in the forum and it looks like this should be part of the solution, but I can’t find information on how to do a selection on methods or the incoming URI.
With the documentation, I have managed to get the GET part working:
I create an ingress and a KongIngress, I give them the same name to allow the routing on methods and then I patch the application service for the proxy part.
I think I worked this out, I am not sure this is the best approach, it looks pretty clunky. I have done the following:
Create 2 services, one named demo-service-get and one demo-service-post (everything else is the same). Add an annotation to each like this, the annotation will refer to two KongIngress (demo-ingress-ki-get and demo-ingress-ki-post)
Create two ingress, note that they will point to a different service and KongIngress. Note the konghq.com/override replacing the annotation of the first iteration.