I have deployed the following resources.
kong in kong namespace
service echo in poc namespace
kubectl apply -f https://gist.githubusercontent.com/hbagdi/0d833181239a39172ba70cbec080bdb9/raw/7f46cf1c9e54562e2c23902daace7ac8edc40427/echo-server.yaml -n poc
Created an ingress with /foo path in poc namespace. Note: /foo is mapped to /echo from echo service.
echo "
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: demo
namespace: poc
annotations:
kubernetes.io/ingress.class: kong
spec:
rules:
- http:
paths:
- path: /foo
backend:
serviceName: echo
servicePort: 80
" | kubectl -n poc apply -f -
- Created the kong plugin
kind: KongPlugin
metadata:
name: default.rate-limiting
namespace: poc
config:
minute: 3
policy: local
plugin: rate-limiting" | kubectl apply -f -
- Patched the service with the default.rate-limiting
kubectl patch -n poc svc echo -p '{"metadata":{"annotations":{"konghq.com/plugins":
"default.rate-limiting"}}}'
As per above logic, 3 request in a minute should be allowed however rate-limiting is not being applied even for more than 3 requests in a minute.