Fares7
Fares7

Reputation: 51

Watch all object Kinds in a Namespace

I am working on a project that watches resources of all object Kinds within a Namespace and perform an identical action as a response to change of status of said resource. Kind of resources includes CRDs and could be different from one Namespace to another depending on the resources created within a Namespace.

Is there a known pattern for dynamically creating controllers for all object Kinds that exist in a Namespace?

A close example of what i'm looking to achieve is a watcher that watches all resources in a Namespace and send a message to a receiver whenever said resources are changed.

Take this scenario for example, the following actions are taken by this watcher when it is started:

  1. For each namespace annotated with watch-namespace: true do the following:
  2. Send manifest of each resources in Namespace to receiver
  3. When resource is changed, send the new manifest to receiver

The watcher must be able to watch all Kinds currently existing in namespace or created in the future. It is also important to note that this watcher does not alter or reconcile the state of the resources it is watching.

Upvotes: 0

Views: 704

Answers (0)

Related Questions