stackrox / kube-linter

KubeLinter is a static analysis tool that checks Kubernetes YAML files and Helm charts to ensure the applications represented in them adhere to best practices.
https://docs.kubelinter.io/
Apache License 2.0
2.89k stars 231 forks source link

Change unset-cpu-requirements check #694

Closed janisz closed 5 months ago

janisz commented 7 months ago

Currently the unset-cpu-requirements requires requests and limits while in general having only requests should be sufficient. Requests are essential for scheduling, and since omitting limits would simply allow the application to utilize a slightly higher amount of CPU if necessary, we should no longer recommend specifying both requests and limits.

The change should happen in check definition

https://github.com/stackrox/kube-linter/blob/e68f7d1cff4bf550c6fbadbc6a6509007b3c1e53/pkg/builtinchecks/yamls/unset-cpu-requirements.yaml#L11

As well in related tests: https://github.com/stackrox/kube-linter/blob/e68f7d1cff4bf550c6fbadbc6a6509007b3c1e53/e2etests/bats-tests.sh#L895