How to deploy kong gateway - kong dbless mode vs using Kubernetes Ingress Controller

Hi, i have got a question in my team how to deal with an Ingress rule related issue he is trying to resolve with Kong Gateway API, hope someone has some advice on the problem and how to approach resolving it.

An example of the ingress is

{
   "apiVersion": "extensions/v1beta1",
   "kind": "Ingress",
   "metadata":
   {
       "name": "hello-world",
       "namespace": "$NAMESPACE",
       "annotations":
       {
           "[ingress.kubernetes.io/secure-backends](http://ingress.kubernetes.io/secure-backends)": "true",
           "[ingress.kubernetes.io/backend-protocol](http://ingress.kubernetes.io/backend-protocol)": "HTTPS",
           "[ingress.kubernetes.io/use-regex](http://ingress.kubernetes.io/use-regex)": "true"
       }
   },
   "spec":
   {
       "tls": [
       {
           "hosts": [
               "hello-world-$NAMESPACE-[place-holder].[co.uk](http://co.uk)"
           ]
       }
   ],
   "rules": [
   {
       "host": ""hello-world-$NAMESPACE-[place-holder].[co.uk](http://co.uk)",
       "http":
       {
           "paths": [
           {
               "path": "/test1/api",
               "backend":
               {
                   "serviceName": "api1-svc",
                   "servicePort": 443
               }
           },
           {
               "path": "/test1/api/history",
               "backend":
               {
                   "serviceName": "history-api-svc",
                   "servicePort": 443
               }
           }
]
 
Example 1
GET request
 {
               "path": "/test1/api/(.+)/birthday",
               "backend":
               {
                   "serviceName": "birthday-api-svc",
                   "servicePort": 443
               }
           },
 
}
 
POST request
 {
               "path": "/test1/api/(.+)/birthday",
               "backend":
               {
                   "serviceName": "person-info-api-svc",
                   "servicePort": 443
               }
           },
 
}
Kubernetes ingress on our given ingress controller currently has no way to redirect requests to different microservices that has the same resource path. (please see example 1)

I am looking for an Open source solution within Kong. How do I deploy kong gateway? via kong dbless mode or using Kubernetes Ingress Controller.

The reason I said kong dbless mode is because many team will be using this and we do not want to manager 100s of databases.```
Posted on Kong forum here
[https://discuss.konghq.com/t/how-should-i-deploy-kong-gateway-in-kubernetes/9435](https://discuss.konghq.com/t/how-should-i-deploy-kong-gateway-in-kubernetes/9435)

Let me know if the problem is not clear and if Kong is the right solution to the problem? any other approach is much appreciated!

So what you are asking for is how direct POST and GET for the same URL to different Services?

If that’s the case, then in the future Kubernetes Gateway API will be your friend, it allows matches by path + HTTP method.
https://gateway-api.sigs.k8s.io/v1alpha2/references/spec/#gateway.networking.k8s.io/v1alpha2.HTTPRouteMatch

Gateway api is the next evolution of Ingress

Thanks a lot! Very nice, in the meantime is there something we can use now?

Meanwhile if you want something “stable”, you probably have to rely on ingress controller proprietary extensions or put for example Kong (yes it can do this) betwee the ingress controller and the real services

If you use nginx ingress I think you can get this to work with it but not sure how convoluted it will get

https://github.com/nginxinc/kubernetes-ingress/blob/v2.0.3/examples-of-custom-resources/advanced-routing/cafe-virtual-server.yaml

Well seems like nginx ingress controller has this VirtualServer resource which can match $request_method to POST or GET

Thanks a lot! Let me see if the customer has some existing routing setup against their ingress controller. very useful help

Ingress was spec’d out as something that is easy-as-pie to support with any reverse HTTP proxy but due to its lack of features every serious reverse proxy project has basically implemented custom alternatives if standard Ingress is not enough

Gateway API attempts to pull the community back together around a more advanced common API

Your question didn’t indicate which ingress controller is used

The customer is using Nginx Ingress controller

If we pursue the Kong solution, we are a bit confused on whether we use a standalone Kong pod or some kind of Kong Ingress controller solution. https://docs.konghq.com/kubernetes-ingress-controller/2.0.x/deployment/overview/

If they use nginx ingress just try the VirtualServer CRD

Ideally use Kong nation for assistance though some of us do loiter in