In kubernetes, you can listen for events using kubectl get events
. This works for other resources, but I would like to know when a Service is created and destroyed. When I run kubectl describe my-service
I get Events: <none>
.
How can I know when a service was created?
When a service gets created, you should get the service listed when you run below command
Kubectl get svc
Every api object has a creation timestamp in the metadata section. Though that doesn’t tell when it is edited. For that you might want an audit webhook or something like Brigade.