annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/limit-connection: "1"
nginx.ingress.kubernetes.io/limit-rpm: "20"
和容器图片版本,我正在使用,
图片:quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.22.0
尝试在十分钟的范围内发送200个请求(每分钟就好像是来自单个ipaddress的20个请求),然后必须拒绝请求。
答案 0 :(得分:0)
答案 1 :(得分:0)
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 ?
答案 2 :(得分:0)
您使用的是哪个nginx入口版本?请使用quay.io/aledbf/nginx-ingress-controller:0.415,然后进行检查,也请查看此链接-https://github.com/kubernetes/ingress-nginx/issues/1839