Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter nodeResources by cpu architecture #459

Merged
merged 2 commits into from
Dec 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions docs/source/analyze/node-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ All filters can be integers or strings that are parsed using the Kubernetes reso

| Filter Name | Description |
|----|----|
| `cpuCapacity` | The amount of CPU available to the node |
| `cpuArchitecture` | The architecture of the CPU available to the node. Expressed as a string, e.g. `amd64` |
| `cpuCapacity` | The amount of CPU available to the node. |
| `cpuAllocatable` | The amount of allocatable CPU after the Kubernetes components have been started |
| `memoryCapacity` | The amount of memory available to the node |
| `memoryAllocatable` | The amount of allocatable Memory after the Kubernetes components have been started |
Expand All @@ -28,6 +29,8 @@ All filters can be integers or strings that are parsed using the Kubernetes reso
| `ephemeralStorageAllocatable` | The amount of ephemeral storage on the node after Kubernetes is running |
| `matchLabel` | Specific selector label or labels the node must contain in its metadata |

CPU and Memory units are expressed as Go [Quantities](https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#Quantity): `16Gi`, `8Mi`, `1.5m`, `5` etc.

## Outcomes

The `when` value in an outcome of this analyzer contains the nodes that match the filters, if any filters are defined.
Expand Down Expand Up @@ -65,7 +68,6 @@ spec:
message: This cluster has enough nodes.
```


```yaml
- nodeResources:
checkName: Every node in the cluster must have at least 16Gi of memory
Expand Down Expand Up @@ -116,17 +118,19 @@ spec:

```yaml
- nodeResources:
checkName: Must have 1 node with 16 GB (available) memory and 5 cores (on a single node)
checkName: Must have 1 node with 16 GB (available) memory and 5 cores (on a single node) with amd64 architecture
filters:
allocatableMemory: 16Gi
cpuArchitecture: amd64
cpuCapacity: "5"
outcomes:
- fail:
when: "count() < 1"
message: This application requires at least 1 node with 16GB available memory and 5 cpu cores
message: This application requires at least 1 node with 16GB available memory and 5 cpu cores with amd64 architecture
- pass:
message: This cluster has a node with enough memory and cpu cores
```

### Filter by labels

> Filtering by labels was introduced in Kots 1.19.0 and Troubleshoot 0.9.42.
Expand Down