Nginx ingress controller rate limiting not working

1/29/2019
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/limit-connection: "1"
    nginx.ingress.kubernetes.io/limit-rpm: "20"

and the container image version, iam using, image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.22.0

trying to send 200 requests in ten mins of range (and per min it is like a 20 requests from a single ipaddress) and after that it has to refuse the requests.

-- raja
kubernetes-ingress

3 Answers

1/29/2019
I changed it to the limit-connections, I am mentioning the annotations in the ingress yml file and applying it and i can in the nginx conf the following 

`worker_rlimit_nofile 15360;
    limit_req_status                503;
    limit_conn_status               503;
    # Ratelimit test_nginx
    # Ratelimit test_nginx `
   ` map $whitelist_xxxxxxxxxxxx $limit_xxxxxxxxxx {
    limit_req_zone $limit_xxxxxxxx zone=test_nginx_rpm:5m rate=20r/m;
            limit_req zone=test_nginx_rpm burst=100 nodelay;
            limit_req zone=test_nginx_rpm burst=100 nodelay;
            limit_req zone=test_nginx_rpm burst=100 nodelay;`


when i kept this annotations, 

 ` nginx.ingress.kubernetes.io/limit-connections: "1" 
  nginx.ingress.kubernetes.io/limit-rpm: "20" `

I can see the above burst and other things in the nginx conf file, can you please tell me these make any differences ?
-- raja
Source: StackOverflow

1/29/2019

Try to change this limit-connection: to limit-connections:

For more info check this

If doesn't help, please put your commands or describe that how are you testing your connection limits.

-- coolinuxoid
Source: StackOverflow

5/29/2019

Which nginx ingress version are you using ? please use quay.io/aledbf/nginx-ingress-controller:0.415 and then check, Also Please look at this link - https://github.com/kubernetes/ingress-nginx/issues/1839

-- Linux guru
Source: StackOverflow