Kubernetes Events

--

What are the events?
Event in kubernetes is an object in the framework that is automatically generated in response to changes with resources — like nodes, pods, or containers. For example, phases across a pod’s lifecycle — like a transition from pending to running, or statuses like successful or failed may trigger a K8s event.
You can see event using following command
kubectl describe <resourceKind> <resourceName>

Events are published from a Controller using an Event recorder, which can be created for a Controller by calling event methods on a Manager. You can see more insights about the event https://github.com/kubernetes/client-go/tree/master/tools/record.
Here you can see generalized function to create the events for custom resource.
Check github link https://github.com/roshanikhairnar/roshani-controller
for more insights https://book-v1.book.kubebuilder.io/beyond_basics/creating_events.html

--

--