teamhephy / router

MIT License
4 stars 10 forks source link

feat(router): add Kubernetes rate limit through environment variables for configuration computation/reload #59 #60

Closed giannoul closed 3 years ago

giannoul commented 3 years ago

This PR introduces the environment variables named RATE_LIMIT_QPS and RATE_LIMIT_BURST that can configure the cfg.QPS and cfg.Burst of the used Config. They are meant to be set on the deployment level so that the pods may get them.

If the variables are not set they will default to "" and thus won't pass the check err == nil, which means that the default settings will be used. This PR tries to fix the issue 59.

giannoul commented 3 years ago

@Cryptophobia thanks for the guidance. I have ran the command gofmt -s -w router.go and commited the updates. I have also formatted the title as you pointed out.