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.
The NetworkPolicy check generates false positives for podSelector: {} like:
networking.k8s.io/v1/NetworkPolicy allow-all-ingress in default 💥
[CRITICAL] NetworkPolicy targets Pod
· The NetworkPolicys selector doesn't match any pods
I'm creating a near copy of #293 because I'm having the same issue using the latest version.
Which version of kube-score are you using?
What did you do?
I defined a NetworkPolicy applicable to all pods in a namespace.
Per the NetworkPolicy documentation
An empty podSelector selects all pods in the namespace
- see under https://kubernetes.io/docs/concepts/services-networking/network-policies/#networkpolicy-resource. There's even an example in the docs at https://kubernetes.io/docs/concepts/services-networking/network-policies/#default-deny-all-ingress-trafficThe NetworkPolicy in question is:
What did you expect to see?
I didn't expect any failures.
What did you see instead?
The
NetworkPolicy
check generates false positives forpodSelector: {}
like: