-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add CEP and CES resources #29244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CEP and CES resources #29244
Conversation
/test |
CiliumSlimEndpoint resource is built using the constructor in pkg/k8s, the same one used by the agent. This limits the flexibility of the constructor, since it is not possible to modify it for the agent or the clustermesh-apiserver specific needs. As an example, the agent starts a CEP informer with an indexer that reads the local node IP, but since the clustermesh-apiserver does not have any cell providing LocalNodeStore, we cannot use that indexer there (clustermesh-apiserver will panic as soon as Resource[CiliumSlimEndpoint] receives an update). To avoid this, the clustermesh-apiserver is modified to use its own CiliumSlimEndpoint constructor, just like we did in the operator for all the k8s resources. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
In order to migrate the current agent CEP watcher to Resource[T], the commit adds the same indexer used in the watcher to the CiliumSlimEndpoint resource. The indexer accesses the local node to get its IP. Differently from the previous indexer implementation, it is mandatory to do that when the indexer function is actually called, otherwise we might panic trying to read an uninitialized local node store reference. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
Add a new constructor for the CiliumEndpointSlice resource. This will be used to migrate the current implementation of the k8s CES watcher to Resource[T]. The resource indexer accesses the local node to get its IP. Differently from the previous indexer implementation in the watcher, it is mandatory to do that when the indexer function is actually called, otherwise we might panic trying to read an uninitialized local node store reference. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
Enable Resource[T] metrics for CiliumSlimEndpoint resource. Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
9f6891d
to
1d38cd2
Compare
@tommyp1ckles @YutaroHayakawa I've made a small change to the |
/test |
This is a required step to migrate the k8s CEP watchers to Resource[T].
First, the PR adds a separate constructor for the CiliumSlimEndpoint resource in the clustermesh-apiserver. The apiserver is currently using the same constructor used by the agent and this limits the ability to add indexers that depend on agent-specific part.
Then, the PR adds the CES resource constructor and the same indexers already used by the informers in the CEP and CES k8s watchers.
Refer to this comment and to the individual commit messages for more information.
Related: #28159