bonny icon indicating copy to clipboard operation
bonny copied to clipboard

dispatch handling and the Events API

Open coryodaniel opened this issue 5 years ago • 2 comments

While it is up the the individual controller to handle error cases, it would be nice to integrate the result of a controller dispatch with the kubernetes events API.

Return from add/modify/delete/reconcile would automatically create events:

  • :ok, {:ok, _} -> Normal
  • :error, {:error, _} -> Warning

There are a lot of fields for an Event. It would be nice to abstract as much of this away as possible, but allow for an explicit return value of something like {:ok, %K8s.Event{}} (doesnt exist) to override any logic bonny provides.

coryodaniel avatar Dec 20 '18 18:12 coryodaniel

~Could be done independently of #22. May be nice to wait and use that interface.~ #22 is merged.

Create a module around events

References:

Regarding event occurrences count, consider a GenServer/Agent vs querying the k8s API and incrementing the count.

coryodaniel avatar Jan 04 '19 21:01 coryodaniel

Related: #5 #4 #2

coryodaniel avatar Jan 04 '19 21:01 coryodaniel

Hi @mruoss Is it now possible to emit events to kubernetes API? Would they be available via kubectl get events or kubectl describe commands ?

sleipnir avatar Sep 22 '22 14:09 sleipnir

With the next version, yes. But although we have integration tests now, this requires some "production approval". Next version is probably going to be an RC...

mruoss avatar Sep 22 '22 17:09 mruoss

You can check guides/controllers.livemd (path to module is still hardcoded and needs to be changed, though)

mruoss avatar Sep 22 '22 17:09 mruoss