troubleshoot
troubleshoot copied to clipboard
Validate Node Labels
Allow for both pre-flight and support bundle to collect & analyse for the presence of specific node labels in order to ascertain if a Deployment with nodeSelector will deploy.
collectors:
nodeLabels:
selector:
- kubernetes.io/os=linux
As a stretch also be able to fail, warn or pass, based upon the count of labeled nodes for each label. e.g. If there are 3 labeled nodes but we have a Statefulset of replicas: 4 with anti-affinity rules (not something troubleshoot needs to work out but support the possibility that manually we can define the rule) so that no two pods run on the same node it would fail if there are insufficient nodes available. i.e.
analyzers:
nodeLabels:
checkName: Must have at least 3 nodes with the specified label
label: kubernetes.io/os=linux
outcomes:
- fail:
when: "count() < 3"
- pass: Enough linux nodes present
Many thanks