From e2ffe1fe0a7dac723d0ba8f05dbbc1564f3e138e Mon Sep 17 00:00:00 2001 From: ada mancini Date: Thu, 29 Dec 2022 12:17:24 -0500 Subject: [PATCH] filter nodeResources by cpu architecture (#459) * filter nodeResources by cpu architecture * describe units for cpu/memory parameters --- docs/source/analyze/node-resources.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/source/analyze/node-resources.md b/docs/source/analyze/node-resources.md index 03e6db2f..83f912c3 100644 --- a/docs/source/analyze/node-resources.md +++ b/docs/source/analyze/node-resources.md @@ -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 | @@ -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. @@ -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 @@ -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.