Node
Read a Node: readiness, allocatable CPU and memory, conditions, taints, and where it is (zone, region, instance type, from the well-known topology labels); and which node a pod is scheduled on.
Reference
| Function | Description |
|---|---|
nodeAllocatableCPU | Returns status.allocatable.cpu. |
nodeAllocatableMemory | Returns status.allocatable.memory. |
nodeCondition | Returns the status string of the named node condition, or "" when absent — common types are Ready, MemoryPressure, and DiskPressure. |
nodeInstanceType | Returns the node’s instance type (label node.kubernetes.io/instance-type). |
nodeReady | Returns true when the Node’s Ready condition status is "True". |
nodeRegion | Returns the node’s region (label topology.kubernetes.io/region). |
nodeTaints | Returns the keys of the node’s taints. |
nodeZone | Returns the node’s zone (label topology.kubernetes.io/zone). |
podNodeName | Returns the node a pod is scheduled on; "" while pending. |
Functions
nodeAllocatableCPU
nodeAllocatableCPU returns status.allocatable.cpu.
{{ nodeAllocatableCPU .node }} → "3920m"
nodeAllocatableMemory
nodeAllocatableMemory returns status.allocatable.memory.
{{ nodeAllocatableMemory .node }} → "15032020Ki"
nodeCondition
nodeCondition returns the status string of the named node condition, or "" when absent — common types are Ready, MemoryPressure, and DiskPressure.
{{ nodeCondition .node "MemoryPressure" }} → "False"
nodeInstanceType
nodeInstanceType returns the node’s instance type (label node.kubernetes.io/instance-type).
{{ nodeInstanceType .node }} → "m5.large"
nodeReady
nodeReady returns true when the Node’s Ready condition status is "True".
{{ nodeReady .node }} → true
nodeRegion
nodeRegion returns the node’s region (label topology.kubernetes.io/region).
{{ nodeRegion .node }} → "us-east-2"
nodeTaints
nodeTaints returns the keys of the node’s taints.
{{ nodeTaints .node }} → [dedicated]
nodeZone
nodeZone returns the node’s zone (label topology.kubernetes.io/zone).
{{ nodeZone .node }} → "us-east-2a"
podNodeName
podNodeName returns the node a pod is scheduled on; "" while pending.
{{ podNodeName .pod }} → "ip-10-0-1-5.us-east-2.compute.internal"