Difference between revisions of "Kubectl events"
Jump to navigation
Jump to search
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{lc}} | {{lc}} | ||
− | + | <code>[[kubectl events]]</code> available since [[v1.28]] (Aug 2023) | |
+ | |||
+ | * <code>[[Failed]], [[FailedSync]], [[Unhealthy]], [[Killing]]</code> | ||
+ | * <code>[[Warning]], [[Normal]]</code> | ||
+ | |||
+ | [[kubectl events --all-namespaces]] | ||
+ | [[kubectl events -A -w]] | ||
+ | [[kubectl events -A]] | grep Warning | ||
+ | [[kubectl events -A]] | Normal | ||
+ | |||
+ | Display events. | ||
+ | |||
+ | Prints a table of the most important information about events. You can request events for a namespace, for all namespace, or filtered to only those pertaining to a specified resource. | ||
+ | |||
+ | Examples: | ||
+ | # List recent events in the default namespace | ||
+ | kubectl events | ||
+ | |||
+ | # List recent events in all namespaces | ||
+ | kubectl events --all-namespaces | ||
+ | |||
+ | # List recent events for the specified pod, then wait for more events and list them as they arrive | ||
+ | kubectl events --for pod/web-pod-13je7 --watch | ||
+ | |||
+ | # List recent events in YAML format | ||
+ | kubectl events -oyaml | ||
+ | |||
+ | # List recent only events of type 'Warning' or 'Normal' | ||
+ | kubectl events --types=Warning,Normal | ||
+ | |||
+ | 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. | ||
+ | |||
+ | --allow-missing-template-keys=true: | ||
+ | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | ||
+ | |||
+ | --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. | ||
+ | |||
+ | --no-headers=false: | ||
+ | When using the default output format, don't print headers. | ||
+ | |||
+ | -o, --output='': | ||
+ | Output format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file). | ||
+ | |||
+ | --show-managed-fields=false: | ||
+ | If true, keep the managedFields when printing objects in JSON or YAML format. | ||
+ | |||
+ | --template='': | ||
+ | Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. | ||
+ | |||
+ | --types=[]: | ||
+ | Output only events of given types. | ||
+ | |||
+ | -w, --watch=false: | ||
+ | After listing the requested events, watch for more events. | ||
+ | |||
+ | Usage: | ||
+ | kubectl events [(-o|--output=)json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file] [--for TYPE/NAME] [--watch] [--types=Normal,Warning] [options] | ||
+ | |||
+ | Use "kubectl options" for a list of global command-line options (applies to all commands). | ||
+ | |||
Line 8: | Line 73: | ||
== Related == | == Related == | ||
* <code>[[kubectl get events]]</code> | * <code>[[kubectl get events]]</code> | ||
+ | * [[Kubernetes troubleshooting]] | ||
== See also == | == See also == |
Latest revision as of 15:31, 27 February 2024
kubectl events
available since v1.28 (Aug 2023)
kubectl events --all-namespaces kubectl events -A -w kubectl events -A | grep Warning kubectl events -A | Normal
Display events. Prints a table of the most important information about events. You can request events for a namespace, for all namespace, or filtered to only those pertaining to a specified resource. Examples: # List recent events in the default namespace kubectl events # List recent events in all namespaces kubectl events --all-namespaces # List recent events for the specified pod, then wait for more events and list them as they arrive kubectl events --for pod/web-pod-13je7 --watch # List recent events in YAML format kubectl events -oyaml # List recent only events of type 'Warning' or 'Normal' kubectl events --types=Warning,Normal 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. --allow-missing-template-keys=true: If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. --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. --no-headers=false: When using the default output format, don't print headers. -o, --output=: Output format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file). --show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format. --template=: Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [1]. --types=[]: Output only events of given types. -w, --watch=false: After listing the requested events, watch for more events. Usage: kubectl events [(-o|--output=)json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file] [--for TYPE/NAME] [--watch] [--types=Normal,Warning] [options] Use "kubectl options" for a list of global command-line options (applies to all commands).
News[edit]
Related[edit]
See also[edit]
Advertising: