kx get
Fetches resources with kubectl and assigns each row an index.
-n <namespace>, label selectors and output flags all work as usual.
A cluster-scoped kind — Nodes, PersistentVolumes, StorageClasses, a cluster-scoped CRD — takes neither -n nor -A. There is no namespace for either to name, so kx refuses them rather than listing something other than what was asked for.
Unrecognized flags are passed through to kubectl.
Usage
kx get [OPTIONS] <resource> [index]... [kubectl flags]Arguments
| Argument | Description |
|---|---|
<resource> | Resource type: pods, deploy, svc, a CRD, or any kubectl kind |
[index]... | Row number from the current listing; run kx state to see it |
Options
| Option | Description |
|---|---|
-A, --all-namespaces | List across every namespace; each row is indexed and carries its own namespace |
--decode | Show Secret data in plaintext; every Secret in the namespace when no index is given |
-k, --key string | With --decode, print only this key’s value |
-m, --match string | Match by name (substring, case-insensitive) |
-n, --namespace string | Namespace to list from; defaults to the current namespace |
-w, --watch | Redraw the listing live as resources change; a watch never completes, so results are not indexed |
-y, --yes | Skip the confirmation prompt for a namespace-wide --decode |
Global options
| Option | Description |
|---|---|
--no-color | Disable styled output |
-h, --help | Show this message and exit |
Examples
kx get pods
kx get pods -n prod -l app=web
kx get deploy -m api
kx get pods 1..3
kx get pods 3..
kx get pods --watch