Get–Secrets - anongitmous/k8sShell GitHub Wiki
Get secret resource objects.
Syntax
Get-Secrets
[<K8sShellCommonParameters>]
[<CommonParameters>]
Description
Get secret resource objects.
See the example output.
Examples
ℹ️ See A Note about the Examples
1. Get all secrets from the cluster constrained by the active cluster configuration
Get-Secrets
- Using aliasing, the above can be shortened to
ksgs
2. Get all opaque secrets from the cluster constrained by the active cluster configuration
Get-Secrets -FieldSelector 'type=Opaque'
- Using aliasing, the above can be shortened to
ksgs -fs 'type=Opaque'
3. Get all generic secrets from the cluster constrained by the active cluster configuration with an override for the namespace of 'foo'
Get-Secrets -Namespace 'foo' -FieldSelector 'type=generic'
- Using aliasing, the above can be shortened to
ksgs -ns 'foo' -fs 'type=generic'
Parameters
See Common Parameters/Namespaced All
Outputs
Mtf.Kubernetes.Models.V1K8sSecret
Example
Supported Field Selectors
📝 - As of 06/2023
- metadata.namespace
- metadata.name
- type
Notes
K8sShell includes the following alias for Get-Secrets:
- ksgs