Nick
Nick

Reputation: 12019

How to know when a Service is created?

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?

Upvotes: 0

Views: 201

Answers (2)

coderanger
coderanger

Reputation: 54181

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.

Upvotes: 1

P Ekambaram
P Ekambaram

Reputation: 17615

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

Kubectl get svc

Upvotes: 0

Related Questions