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-memory-requirements check #695

Open janisz opened 7 months ago

janisz commented 7 months ago

Currently the unset-memory-requirements requires both requests and limits. This is redundant as request if not set will be copied from limits. The memory differs from CPU as with not enough CPU the container will slow down while with missing memory it will be killed. That's why requirements and limits should be set to same value.

The change should happen in check template definition https://github.com/stackrox/kube-linter/blob/24d1fe33226db4ffd03acadda46198a1338c4025/pkg/builtinchecks/yamls/unset-memory-requirements.yaml#L11 As well as in the related tests: https://github.com/stackrox/kube-linter/blob/e68f7d1cff4bf550c6fbadbc6a6509007b3c1e53/e2etests/bats-tests.sh#L916