Get–Nodes - anongitmous/k8sShell GitHub Wiki

Get node objects.

Syntax

Get-Nodes

[<K8sShellCommonParameters>]
[<CommonParameters>]

Description

This retrieves node objects from the cluster.

See the example output.

Examples

ℹ️ See A Note about the Examples

1. Get all nodes

Get-Nodes

  • Using aliasing, the above can be shortened to
    ksgn

2. Get all of the c5.large nodes from an AWS deployment

Get-Nodes -LabelSelector 'beta.kubernetes.io/instance-type==c5.large'

  • Using aliasing, the above can be shortened to
    ksgn -ls 'beta.kubernetes.io/instance-type==c5.large'

3. Get a specific node using the field selector and node name

Get-Nodes -FieldSelector "metadata.name=ip-172-40-10-88.us-east-2b.compute.internal"

  • Using aliasing, the above can be shortened to
    ksgn -fs "metadata.name=ip-172-40-10-88.us-east-2b.compute.internal"

Parameters

See Common Parameters/Namespaced All

Outputs

Mtf.Kubernetes.Models.V1K8sNode

Example

image

Supported Field Selectors

📝 - As of 06/2023

  • metadata.name
  • metadata.namespace
  • spec.unschedulable

Notes

K8sShell includes the following alias for Get-Nodes:

  • ksgn

Related