Skip to content

Commit

Permalink
chore: add node resources analyser example
Browse files Browse the repository at this point in the history
Example of node resources analyser showing how to use
nodeCondition(conditionType) when clause which can be used
in preflights or support bundles

Signed-off-by: Evans Mungai <[email protected]>
  • Loading branch information
banjoh committed Jan 30, 2025
1 parent 1d3ab61 commit 7dc12b6
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion docs/source/analyze/node-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The conditional in the `when` value supports the following:
| `sum(filterName)` | Sum of filterName in all nodes that match any filter specified |
| `min(filterName)` | Min of filterName in all nodes that match any filter specified |
| `max(filterName)` | Max of filterName in all nodes that match any filter specified |
| `nodeCondition(conditionType)` | used for checking node conditions such as Ready, PIDPressure, etc |
| `nodeCondition(conditionType)` | used for checking [node conditions](https://kubernetes.io/docs/reference/node/node-status/#condition) such as Ready, PIDPressure, etc |

## Example Analyzer Definition

Expand Down Expand Up @@ -136,6 +136,20 @@ spec:
message: This cluster has a node with enough memory and cpu cores
```
```yaml
- nodeResources:
checkName: Node status check
outcomes:
- fail:
when: "nodeCondition(Ready) == False"
message: "Not all nodes are online."
- fail:
when: "nodeCondition(Ready) == Unknown"
message: "Not all nodes are online."
- pass:
message: "All nodes are online."
```
### Filter by labels
> Filtering by labels was introduced in Kots 1.19.0 and Troubleshoot 0.9.42.
Expand Down

0 comments on commit 7dc12b6

Please sign in to comment.