Skip to content

Instantly share code, notes, and snippets.

@haproxytechblog
Last active September 8, 2021 16:07
Show Gist options
  • Save haproxytechblog/218319b074ca579d3ac1b1883822627d to your computer and use it in GitHub Desktop.
Save haproxytechblog/218319b074ca579d3ac1b1883822627d to your computer and use it in GitHub Desktop.
Rate Limiting with the HAProxy Kubernetes Ingress Controller
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: web-ingress
namespace: default
annotations:
  haproxy.org/rate-limit-requests: 10
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: web-ingress
namespace: default
annotations:
  haproxy.org/rate-limit-requests: 10
  haproxy.org/rate-limit-period: "1s"
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: web-ingress
namespace: default
annotations:
  haproxy.org/rate-limit-requests: 10
  haproxy.org/rate-limit-period: "1s"
  haproxy.org/rate-limit-status-code: "429"
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: web-ingress
namespace: default
annotations:
  haproxy.org/rate-limit-requests: 10
  haproxy.org/rate-limit-period: "1s"
  haproxy.org/rate-limit-status-code: "429"
  haproxy.org/rate-limit-size: 1000000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment