How to know when a Service is created?

5/18/2019

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?

-- Nick
kubernetes

2 Answers

5/18/2019

When a service gets created, you should get the service listed when you run below command

Kubectl get svc
-- P Ekambaram
Source: StackOverflow

5/18/2019

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.

-- coderanger
Source: StackOverflow