Show–ServicePorts - anongitmous/k8sShell GitHub Wiki
Displays complete port information for services.
Syntax
Show-ServicePorts
-Services <Mtf.Kubernetes.Models.V1K8sService[]>
[<CommonParameters>]
Description
By default, the Mtf.Kubernetes.ModelsV1K8sService object returned by the Get–K8sServices cmdlet returns fields that list the port and target port along with protocols concatenated in two fields respectively, but it does not give detail, nor e.g., the node port. Piping those objects into this cmdlet gives detailed port information.
This is essentially a utility cmdlet: what it achieves can be achieved via a PowerShell script that makes use of the output of Get–K8sServices.
See the example output.
Examples
ℹ️ See A Note about the Examples
1. Show the service ports for every service in the configured namespace
Get-K8sServices | Show-ServicePorts
- Using aliasing, the above can be shortened to
ksgsvc | ksssp
Parameters
-Services
- The output from a call to Get–K8sServices.
| Type: | Mtf.Kubernetes.Services.V1K8sService[] |
| Aliases: | |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Outputs
Mtf.Kubernetes.Models.V1K8sServicePort
Example
Notes
K8sShell includes the following alias for Show-ServicePorts:
- ksssp