Skip to content

Quickstart

List something

kx get pods
Pods · diagnostics · 14 items
   X    NAME                                     READY    STATUS              RESTARTS           AGE
   1    api-badimage-b97d844fd-s75rr             0/1      ImagePullBackOff       0               28d
   2    billing-flaky-b7878b475-dm9sk            1/1      Running               15 (13h ago)     28d
   3    cache-oom-cc849dbdb-2qdkw                0/1      CrashLoopBackOff    2524 (98s ago)     28d
   4    frontend-notready-7fc649587b-r4fh4       0/1      Running                4 (13h ago)     28d
   5    frontend-notready-7fc649587b-zvtb5       0/1      Running                4 (13h ago)     28d
   6    memory-pressure                          1/1      Running                2 (13h ago)     22d
   7    migration-backofflimit-qwhdn             0/1      Error                  0               22d
Pods · diagnostics · 14 items
   X    NAME                                     READY    STATUS              RESTARTS           AGE
   1    api-badimage-b97d844fd-s75rr             0/1      ImagePullBackOff       0               28d
   2    billing-flaky-b7878b475-dm9sk            1/1      Running               15 (13h ago)     28d
   3    cache-oom-cc849dbdb-2qdkw                0/1      CrashLoopBackOff    2524 (99s ago)     28d
   4    frontend-notready-7fc649587b-r4fh4       0/1      Running                4 (13h ago)     28d
   5    frontend-notready-7fc649587b-zvtb5       0/1      Running                4 (13h ago)     28d
   6    memory-pressure                          1/1      Running                2 (13h ago)     22d
   7    migration-backofflimit-qwhdn             0/1      Error                  0               22d
Pods · diagnostics · 14 items
   X    NAME                                     READY    STATUS              RESTARTS           AGE
   1    api-badimage-b97d844fd-s75rr             0/1      ImagePullBackOff       0               28d
   2    billing-flaky-b7878b475-dm9sk            1/1      Running               15 (13h ago)     28d
   3    cache-oom-cc849dbdb-2qdkw                0/1      CrashLoopBackOff    2524 (99s ago)     28d
   4    frontend-notready-7fc649587b-r4fh4       0/1      Running                4 (13h ago)     28d
   5    frontend-notready-7fc649587b-zvtb5       0/1      Running                4 (13h ago)     28d
   6    memory-pressure                          1/1      Running                2 (13h ago)     22d
   7    migration-backofflimit-qwhdn             0/1      Error                  0               22d
Pods · diagnostics · 14 items
   X    NAME                                     READY    STATUS              RESTARTS           AGE
   1    api-badimage-b97d844fd-s75rr             0/1      ImagePullBackOff       0               28d
   2    billing-flaky-b7878b475-dm9sk            1/1      Running               15 (13h ago)     28d
   3    cache-oom-cc849dbdb-2qdkw                0/1      CrashLoopBackOff    2524 (99s ago)     28d
   4    frontend-notready-7fc649587b-r4fh4       0/1      Running                4 (13h ago)     28d
   5    frontend-notready-7fc649587b-zvtb5       0/1      Running                4 (13h ago)     28d
   6    memory-pressure                          1/1      Running                2 (13h ago)     22d
   7    migration-backofflimit-qwhdn             0/1      Error                  0               22d
Pods · diagnostics · 14 items
   X    NAME                                     READY    STATUS              RESTARTS           AGE
   1    api-badimage-b97d844fd-s75rr             0/1      ImagePullBackOff       0               28d
   2    billing-flaky-b7878b475-dm9sk            1/1      Running               15 (13h ago)     28d
   3    cache-oom-cc849dbdb-2qdkw                0/1      CrashLoopBackOff    2524 (99s ago)     28d
   4    frontend-notready-7fc649587b-r4fh4       0/1      Running                4 (13h ago)     28d
   5    frontend-notready-7fc649587b-zvtb5       0/1      Running                4 (13h ago)     28d
   6    memory-pressure                          1/1      Running                2 (13h ago)     22d
   7    migration-backofflimit-qwhdn             0/1      Error                  0               22d
Pods · diagnostics · 14 items
   X    NAME                                     READY    STATUS              RESTARTS           AGE
   1    api-badimage-b97d844fd-s75rr             0/1      ImagePullBackOff       0               28d
   2    billing-flaky-b7878b475-dm9sk            1/1      Running               15 (13h ago)     28d
   3    cache-oom-cc849dbdb-2qdkw                0/1      CrashLoopBackOff    2524 (99s ago)     28d
   4    frontend-notready-7fc649587b-r4fh4       0/1      Running                4 (13h ago)     28d
   5    frontend-notready-7fc649587b-zvtb5       0/1      Running                4 (13h ago)     28d
   6    memory-pressure                          1/1      Running                2 (13h ago)     22d
   7    migration-backofflimit-qwhdn             0/1      Error                  0               22d
Pods · diagnostics · 14 items
   X    NAME                                     READY    STATUS              RESTARTS           AGE
   1    api-badimage-b97d844fd-s75rr             0/1      ImagePullBackOff       0               28d
   2    billing-flaky-b7878b475-dm9sk            1/1      Running               15 (13h ago)     28d
   3    cache-oom-cc849dbdb-2qdkw                0/1      CrashLoopBackOff    2524 (99s ago)     28d
   4    frontend-notready-7fc649587b-r4fh4       0/1      Running                4 (13h ago)     28d
   5    frontend-notready-7fc649587b-zvtb5       0/1      Running                4 (13h ago)     28d
   6    memory-pressure                          1/1      Running                2 (13h ago)     22d
   7    migration-backofflimit-qwhdn             0/1      Error                  0               22d
Pods · diagnostics · 14 items
   X    NAME                                     READY    STATUS              RESTARTS           AGE
   1    api-badimage-b97d844fd-s75rr             0/1      ImagePullBackOff       0               28d
   2    billing-flaky-b7878b475-dm9sk            1/1      Running               15 (13h ago)     28d
   3    cache-oom-cc849dbdb-2qdkw                0/1      CrashLoopBackOff    2524 (99s ago)     28d
   4    frontend-notready-7fc649587b-r4fh4       0/1      Running                4 (13h ago)     28d
   5    frontend-notready-7fc649587b-zvtb5       0/1      Running                4 (13h ago)     28d
   6    memory-pressure                          1/1      Running                2 (13h ago)     22d
   7    migration-backofflimit-qwhdn             0/1      Error                  0               22d
Pods · diagnostics · 14 items
   X    NAME                                     READY    STATUS              RESTARTS           AGE
   1    api-badimage-b97d844fd-s75rr             0/1      ImagePullBackOff       0               28d
   2    billing-flaky-b7878b475-dm9sk            1/1      Running               15 (13h ago)     28d
   3    cache-oom-cc849dbdb-2qdkw                0/1      CrashLoopBackOff    2524 (99s ago)     28d
   4    frontend-notready-7fc649587b-r4fh4       0/1      Running                4 (13h ago)     28d
   5    frontend-notready-7fc649587b-zvtb5       0/1      Running                4 (13h ago)     28d
   6    memory-pressure                          1/1      Running                2 (13h ago)     22d
   7    migration-backofflimit-qwhdn             0/1      Error                  0               22d
Pods · diagnostics · 14 items
   X    NAME                                     READY    STATUS              RESTARTS           AGE
   1    api-badimage-b97d844fd-s75rr             0/1      ImagePullBackOff       0               28d
   2    billing-flaky-b7878b475-dm9sk            1/1      Running               15 (13h ago)     28d
   3    cache-oom-cc849dbdb-2qdkw                0/1      CrashLoopBackOff    2524 (99s ago)     28d
   4    frontend-notready-7fc649587b-r4fh4       0/1      Running                4 (13h ago)     28d
   5    frontend-notready-7fc649587b-zvtb5       0/1      Running                4 (13h ago)     28d
   6    memory-pressure                          1/1      Running                2 (13h ago)     22d
   7    migration-backofflimit-qwhdn             0/1      Error                  0               22d

That is kubectl’s own table with a column in front of it. The numbers are the whole idea: they are what every other command takes.

Use the numbers

kx describe 3
kx logs 2 -f --tail=100
kx yaml 1
kx exec 2

The index is resolved against the listing you just ran, so 3 means the third row of it — cache-oom-cc849dbdb-2qdkw above — until you list something else.

Several at once, and ranges:

kx describe 1 3 5     # three resources
kx delete 3..5        # a range
kx delete ..3         # from the start
kx delete 5..         # to the end of the listing

Drop the get

Known kinds can be spelled directly, kubectl’s shorthands included:

kx pods
kx deploy -n kube-system
kx svc -m api

An integer after a kind relists just that row — kx po 3. Anything kx doesn’t recognise as a kind falls back to kx get <resource>, so a CRD you have installed works the same way.

Narrow the listing

--match/-m filters rows by name substring, and any flag kx doesn’t recognise goes through to kubectl untouched:

kx pods -m api
kx pods -n prod -l app=web
kx pods -A

-A is indexed like everything else: each row remembers the namespace it came from, so kx logs 7 reaches into a namespace you aren’t in.

See where you are

kx state

That prints the listing your indexes currently resolve against, and the namespace and context it was read in. kx keeps the last ten listings — see state and history for moving between them.

Where next