5

I am using Azure kubernetes service(managed servcie). kubectl get events -namespace abc says there are no resources.

I used get the events all the time, on the same cluster and suddenly it returns there are no resources. Can some one help out?

Remark: This is a cluster which is currently having lots of traffic and should have events.

papanito
  • 2,349
  • 2
  • 32
  • 60
krishna m
  • 227
  • 1
  • 4
  • 19

4 Answers4

2

Try deleting some pod, then check for

kubectl get events -w 

in that namespace, you will get some events, so likely when you were checking, there was no event going on. Both the Control Plane components and the Kubelet emit events to the API server as they perform actions like pod creation, deletion, replica set creation, hpa etc

Tushar Mahajan
  • 2,044
  • 1
  • 7
  • 18
1

Have a look at Timeline of kubernetes events. Events seem to be retained only a certain amount of time, so maybe there are no events in the particular namespace. Also as 4c74356b41 suggest check kube-system ns you most probably will see events.

papanito
  • 2,349
  • 2
  • 32
  • 60
0

probably means there no events. Now I see only 1 event in kube-system namespace. You will most likely see some events in that namespace:

kubectl get events -n kube-system

which will confirm everything is fine.

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
0

The 'namespace' parameter sould be prefixed with two hyphens. The right command is

kubectl get events --namespace abc

OR

kubectl get events -n abc

'kubectl get events' misleads by throwing an error message as "No resources found in default namespace." when the syntax of the command is wrong.

Vishwas M.R
  • 1,341
  • 16
  • 23