A tool to analyze NodeGroups and PodDisruptionBudgets (PDB) for potential violations during cluster updates.
This program analyzes OpenShift/Kubernetes clusters to identify potential PodDisruptionBudget violations that could occur when NodeGroups (Machine Config Pools) are updated. It helps cluster administrators understand which PDBs might be violated during rolling updates and provides interactive remediation options.
- NodeGroup Analysis: Groups nodes by Machine Config Pools (MCPs) and analyzes their serial upgrade settings
- PDB Violation Detection: Identifies scenarios where taking down a NodeGroup would violate PDB constraints
- Interactive Remediation: Option to interactively fix violations by safely deleting pods
- Verbose Reporting: Detailed output including serial upgrade considerations
./pdbCheck -kubeconfig /path/to/kubeconfig [options]-kubeconfig string: Path to kubeconfig file (defaults to KUBECONFIG env var)-all: Include violations from serial upgrade MCPs (maxUnavailable=1) in results-verbose: Enable verbose output for detailed reporting-fix-violations: Enable interactive mode to fix PDB violations by deleting pods-loglevel string: Set log level (debug|info|warn|error)-debug: Set log level to debug
Basic analysis:
./pdbCheck -kubeconfig ~/.kube/configInclude all violations (including serial upgrade MCPs):
./pdbCheck -kubeconfig ~/.kube/config -allVerbose analysis with detailed output:
./pdbCheck -kubeconfig ~/.kube/config -verboseInteractive remediation mode:
./pdbCheck -kubeconfig ~/.kube/config -fix-violations- NodeGroup Discovery: Discovers Machine Config Pools and groups nodes accordingly
- PDB Analysis: Finds all PodDisruptionBudgets in the cluster and their associated pods
- Violation Detection: Calculates whether taking down any NodeGroup would violate PDB constraints
- Serial Upgrade Handling: Considers whether NodeGroups have serial upgrade settings (maxUnavailable=1)
- Reporting: Provides detailed output of potential violations and remediation options
go build -o pdbCheck main.gogo test -v