kube2iam
kube2iam copied to clipboard
Add AssumeRole error cache
When AssumeRole is successful, the success is cached for (by default) 15 minutes. On failure, there is no cache. In cases of misconfiguration, this can result in a large number of AssumeRole calls against the AWS API, which, in extreme cases, can result in API rate limiting, causing other applications in the AWS account to experience failures.
This adds a negative cache on AssumeRole to prevent error cases from spamming the API. This is set to 0 by default to preserve existing behavior, but a value of 30 seconds to 1 minute would be reasonable.
Coverage decreased (-0.3%) to 19.474% when pulling 46bce9d042450725143364e209d66814cced58d3 on schleyfox:add-negative-cache into 80efbb12e3650ab35de87230a0a300ffdc5cbe84 on jtblin:master.
@jrnt30 can you look at this?