Rate limiting inside kubernetes cluster

Viewed 96

I have multiple services running inside a kubernetes cluster and all talking to each other. I want one of the services to have a rate limiting feature. This means that for certain caller ids it should accept only 50 calls per minute and reject all others with 429 "Too many requests". This limiting should happen for calls inside the same cluster.

Can this be done using k8 objects/features?

1 Answers

This can't be defined directly in Kubernetes. You have to define this behaviour at some other place, for example:

  • In the application itself
  • In a service mesh, like Istio
  • In an API Gateway, like Ambassador

...or just in some other third-party component.

Related