kubectl events

One small neat feature that comes with the latest Kubernetes 1.24 version is how much easier we could deal with Kubernetes events using kubectl tool. Before kubectl treat events like any other resources passed as get argument, effect was not satisfied because ie. you receive unsorted events list by “LAST SEEN” which can be fixed by using --sort-by='.lastTimestamp', but you need to know the column name for Event. Now there is a dedicated subcommand currently in alpha state called events in kubectl version:

$ kubectl version --short
Client Version: v1.23.1
...

which provides:

$ kubectl alpha events --help
...
Options:
  -A, --all-namespaces=false: If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
      --chunk-size=500: Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.
      --for='': Filter events to only those pertaining to the specified resource.
  -w, --watch=false: After listing the requested events, watch for more events.
...

that help us avoid using generic kubectl and some other “pipe” tools like grep.

comments powered by Disqus

powered by Hugo and Noteworthy theme