kubernetes

Why does kubectl get events shows nothing unlike logs?


I am trying to figure out what is wrong. My comamand

kubectl get events --namespace kube-system  | grep -i konnectivity-agent-6688d6dbfc-rsql5
No resources found in kube-system namespace

If I opt for specific namespace

kubectl get events --all-namespaces  | grep -i kube-proxy-2pdxb

shows nothing. Anyway pod logs are more informative

 I1127 10:47:53.070693       1 proxier.go:823] "Syncing iptables rules"
I1127 10:47:53.126287       1 proxier.go:790] "SyncProxyRules complete" elapsed="55.635032ms"
I1127 10:47:53.126314       1 bounded_frequency_runner.go:296] sync-runner: ran, next possible in 1s, periodic in 1h0m0s
I1127 10:53:51.648429       1 utils.go:180] "Skipping service due to cluster IP" service="elk/logstash-logstash-headless" clusterIP="None"
I1127 10:53:51.648462       1 utils.go:180] "Skipping service due to cluster IP" service="elk/logstash-logstash-headless" clusterIP="None"

How to reformat my kubectl get events command?


Solution

  • No resources found in kube-system namespace error typically indicates that there are no events available in the kube-system namespace.

    Events seem to be retained only for a certain amount of time, so maybe there are no events in the particular namespace.

    Run the command kubectl get events --all - namespaces to check if there are event available in other namespaces

    Refer to this link on Timeline of kubernetes events.