Get–Namespaces - anongitmous/k8sShell GitHub Wiki

Retrieve namespace objects from the cluster.

Syntax

Get-Namespaces

[<K8sShellCommonParameters>]
[<CommonParameters>]

Description

Retrieve namespace objects from the cluster.

See the example output.

Examples

ℹ️ See A Note about the Examples

1. List all of the namespaces for the active cluster config

Get-Namespaces

  • Using aliasing, the above can be shortened to
    ksgns

2. Get all of the namespaces for the active cluster config that have an 'Active' phase

Get-Namespaces -FieldSelector 'status.phase=Active'

  • Using aliasing, the above can be shortened to
    ksgns -fs 'status.phase=Active'

Parameters

See Common Parameters/Namespaced All

Outputs

Mtf.Kubernetes.Models.V1K8sNamespace

Example

image

Supported Field Selectors

📝 - As of 06/2023

  • metadata.name
  • status.phase

Notes

K8sShell includes the following alias for Get-Namespaces:

  • ksgns

Related