kube-linter icon indicating copy to clipboard operation
kube-linter copied to clipboard

[FEATURE_REQUEST] Support HPA maxReplicas

Open BlythMeister opened this issue 2 years ago • 3 comments

Description of the problem/feature request Add check for HPA maxReplicas which functions in the same way as minReplicas

Additional context We are migrating from datree and this was a check they have: https://hub.datree.io/built-in-rules/ensure-hpa-maximum-replicas

BlythMeister avatar Aug 04 '23 12:08 BlythMeister

As @BlythMeister pointed we already have https://github.com/stackrox/kube-linter/blob/6ba361ac592fbb27e520ff04610799bdbeb21624/pkg/templates/hpareplicas/template.go#L18 template but it's limited to check minimum. Maybe we should add a new template that will check if replicas is in range and reuse it in min replicas to keep backward compatibility.

janisz avatar Aug 07 '23 17:08 janisz

As a use case, maximum is useful in a larger org to ensure someone doesn't go crazy on HPA and set like max 50 (don't ask me why...please don't ask me why!)

BlythMeister avatar Aug 07 '23 17:08 BlythMeister