Skip to content

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

ArgumentDescription
<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

OptionDescription
-A, --all-namespacesList across every namespace; each row is indexed and carries its own namespace
--decodeShow Secret data in plaintext; every Secret in the namespace when no index is given
-k, --key stringWith --decode, print only this key’s value
-m, --match stringMatch by name (substring, case-insensitive)
-n, --namespace stringNamespace to list from; defaults to the current namespace
-w, --watchRedraw the listing live as resources change; a watch never completes, so results are not indexed
-y, --yesSkip the confirmation prompt for a namespace-wide --decode

Global options

OptionDescription
--no-colorDisable styled output
-h, --helpShow 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