This configuration can be used to set up a test cluster to verify use of the HAPROXY Ingress Controller for Rate Limiting.
- Create a test project with a Kubernetes cluster
- Apply all of the yaml files
- Use
kubectl get services -A
to get the external IP of the ingress-controller - Test using
curl -v [ip]:80/echo
ten times, confirming 200 response each time - Confirm 403 on the eleventh attempt
- The echo ingress is set up to limit rate on http-request
- The echo ingress specifies haproxy in ingressClassName
- The haproxy-ingress file contains an IngressClass that binds the ingressClassName to the ingress controller
Note that the haproxy-ingress file is mostly identical to the one in the installation documentation under "Install with kubectl".
For detail on the rate limiting, search for stick-table in the yaml files and refer to the Introduction to HAProxy Stick Tables.
The Ingress Controller 1.5 announcement gives additional detail on this functionality.