Skip to content

kx events

Shows Kubernetes events recorded against the exact object each index names — unlike kx logs, this doesn’t reach into the Pods a Deployment or StatefulSet owns.

--since bounds how far back the listing looks, in the same vocabulary kx diag reads — s, m, h or d: 90s, 30m, 12h, 7d. Without it every event the cluster still holds is listed — on a default cluster roughly the last hour, since that is how long the API server keeps an event before dropping it. Set events_max_age in config.toml to choose a window once rather than per run.

--sort orders each table by its columns, named separated by commas as the header reads them, with a leading ‘-’ to sort one from largest down: TYPE, REASON, KIND and MESSAGE as text, AGE as a duration, so ‘age’ puts the newest first. Ties keep the order the cluster returned them in.

Usage

kx events [OPTIONS] <index>...

Arguments

ArgumentDescription
<index>...Row number from the current listing, @name for a mark, or kind/name such as deploy/api

Options

OptionDescription
--context stringKubeconfig context of a kind/name target; defaults to the current one. An index carries its own
-n, --namespace stringNamespace of a kind/name target; defaults to the current namespace. An index carries its own
--since stringOnly events newer than this; s, m, h or d: 90s, 30m, 12h, 7d. Defaults to events_max_age, which is unset: every event the cluster still holds is listed
--sort stringSort the events by their columns: ‘-type,age’ puts Warnings first, the newest first in each

Global options

OptionDescription
--no-colorDisable styled output
-h, --helpShow this message and exit

Examples

kx events 1
kx events 1 2
kx events 1 --since 30m
kx events deploy/api -n prod
kx events 1 --sort -type,age
kx events 1..3
kx events 3..