zegl / kube-score

Kubernetes object analysis with recommendations for improved reliability and security. kube-score actively prevents downtime and bugs in your Kubernetes YAML and Charts. Static code analysis for Kubernetes.
https://kube-score.com
MIT License
2.67k stars 175 forks source link

ignore-test test pods #548

Open drewwells opened 11 months ago

drewwells commented 11 months ago

Which version of kube-score are you using? latest

Add the ability to ignore pods as part of helm test only.

zegl commented 11 months ago

Hey,

Could you please share a more detailed example of what you want to do?

drewwells commented 11 months ago

Sure thing, some charts have test containers that are included as part of manifests. I want to be able to ignore any kube failures inside just those files. Helm test files must be in a test folder https://helm.sh/docs/topics/chart_tests/#example-test

It appears you can also use annotations to define some files as only used for tests. These pods are short lived, so they don't have the same stringent requirements as a long running pod for cpu/memory usage.

zegl commented 11 months ago

Cool, thanks for the link! Just to verify, the idea is that objects with a "helm.sh/hook": "test" annotation should be ignored by kube-score?

drewwells commented 11 months ago

Correct, presence of that annotation is sufficient. I think helm3 also treats objects in test/ subdir differently without the annotation, but annotation is a clearer way to ignore a test object.

On August 4, 2023, Anthony Sottile @.***> wrote:

Cool, thanks for the link! Just to verify, the idea is that objects with a " helm.sh/hook": "test" annotation should be ignored by kube-score?

— Reply to this email directly, view it on GitHub https://github.com/zegl/kube-score/issues/548#issuecomment-1665292178, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB2MEYQHLXRP3GCR7H7QVTXTS4HHANCNFSM6AAAAAA3BRTYBQ . You are receiving this because you authored the thread.Message ID: @.***>