Get–Endpoints - anongitmous/k8sShell GitHub Wiki

Retrieve endpoint objects.

Syntax

Get-Endpoints

[-Pods <Mtf.Kubernetes.Models.V1K8sPod[]>]
[-Services <Mtf.Kubernetes.Models.V1K8sService[]>]
[<K8sShellCommonParameters>]
[<CommonParameters>]

Description

Retrieve the endpoint objects from the cluster for the current namespace.

See the example output.

Examples

ℹ️ See A Note about the Examples

1. Get all endpoints for the current cluster and namespace

Get-Endpoints

  • Using aliasing, the above can be shortened to
    ksgep

2. Display all endpoints which have a non-null/empty ReadyIPs property

Get-Endpoints | Where-Object {[string]::IsNullOrWhiteSpace($_.ReadyIPs) -ne $true}

  • Add -Watch Added to watch for these
  • Using aliasing, the above can be shortened to
    ksgep | ? {[string]::IsNullOrWhiteSpace($_.ReadyIPs) -ne $true}

3. Display all endpoints which have a non-null/empty NotReadyIPs property

Get-Endpoints | Where-Object {[string]::IsNullOrWhiteSpace($_.NotReadyIPs) -ne $true}

  • Add -Watch Added to watch for these
  • Using aliasing, the above can be shortened to
    ksgep | ? {[string]::IsNullOrWhiteSpace($_.NotReadyIPs) -ne $true}

4. Display the endpoints for service objects

Get-K8sServices | Get-Endpoints

  • Using aliasing, the above can be shortened to
    ksgsvc | ksgep

4. Display the endpoints for pod objects

Get-Pods | Get-Endpoints

  • Using aliasing, the above can be shortened to
    ksgp | ksgep

Parameters

-Pods

Type: Mtf.Kubernetes.Models.V1K8sPod[]
Aliases:
Position: Named
Default value: None
Accept pipeline input: True
Accept wildcard characters: False

-Services

Type: Mtf.Kubernetes.Models.V1K8sService[]
Aliases:
Position: Named
Default value: None
Accept pipeline input: True
Accept wildcard characters: False

Outputs

Mtf.Kubernetes.Models.V1K8sEndpoint

Example

image

Supported Field Selectors

📝 - As of 06/2023

  • metadata.name
  • metadata.namespace

Notes

K8sShell includes the following alias for Get-Endpoints:

  • ksgep

Related