Kong Ingress Controller has no effect on Kong Plugins

9/15/2019

I have gone through kong-ingress-controller deployment and getting started doc and done everything mentioned.

  1. Update User Permissions
  2. Deploy Kong Ingress Controller
  3. Setup environment variables
  4. Created Ingress with Routes

Everything works fine, I can access my applications based on the routes. But when I added rate-limit plugins or any other plugins it does not take any effect.

ingress.yaml :

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
 name: my-ingress
 namespace: default
 annotations:
  kubernetes.io/ingress.class: kong
  plugins.konghq.com: http-ratelimit, http-auth
spec:
 rules:
  - host: foo.bar
  http:
    paths:
    - path: /users
      backend:
        serviceName: my-service
        servicePort: 80 

rate-limit.yaml :

apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
 name: http-ratelimit
 labels:
   global: 'true'
config:
 minute: 5
plugin: rate-limiting

But the rate limit plugin has no effect on my ingress.

NB: The kong-ingress-controller is in kong namespace but the other resources are in default namespace. I tried to move everything to kong namespace then the plugins works but service does not work as it is in default namespace.

Thanks in advance.

-- Hossain Ahamed
kong
kong-ingress
kong-plugin
kubernetes

1 Answer

9/17/2019

Looking at the Kong docs, the rate-limit YAML looks correct. If the resource is configured correctly, Kong is not matching the request against the ingress resource because the user is not sending the correct request.

-- K. Chen
Source: StackOverflow