Get–PodMetrics - anongitmous/k8sShell GitHub Wiki
Return information about pod memory and CPU usage.
Syntax
Get-PodMetrics
-Pods <Mtf.Kubernetes.Models.V1K8sPod[]>
[<K8sShellCommonParameters>]
[<CommonParameters>]
Description
If called without any arguments, this cmdlet returns the memory and CPU usage values for all pods per the active cluster configuration.
If pod objects are piped into it, this cmdlet returns the memory and CPU usage values only for those pods that were piped in.
See the example output.
Examples
ℹ️ See A Note about the Examples
1. Return the CPU and memory usage for every pod per the active cluster configuration
Get-PodMetrics
- If the default namespace is
$nullor'', then metrics for all pods from all namespaces will be returned.- Using aliasing, the above can be shortened to
ksgpm
Parameters
-Pods
- The output of a call to Get–Pods.
| Type: | Mtf.Kubernetes.Models.V1K8sPod[] |
| Aliases: | |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Outputs
Mtf.Kubernetes.Models.V1K8sPodMetrics
Example
Notes
K8sShell includes the following alias for Get-PodMetrics:
- ksgpm