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.77k stars 178 forks source link

score: add check for PodDisruptionBudget with no policy #396

Closed kd7lxl closed 3 years ago

kd7lxl commented 3 years ago

This adds check for PodDisruptionBudget with no policy. PDBs should specify a policy with minAvailable or maxUnavailable. This test flags PDBs that don't specify either.

This is based on the assumption that the PDB is invalid without minAvailable or maxUnavailable defined -- do you know of any cases where it's valid to not specify either? I don't. When I've tested a PDB like this in k8s (by accident 😄), the controller sets .status.expectedPods: 0 regardless of the deployment replicas field.

RELNOTE: Add check for PodDisruptionBudget with no policy
bors[bot] commented 3 years ago

Build succeeded: