Firstly, the controller needs to communicate with the apiserver, so there should be a client
. And the client
request you to tell it
Then you can use the client
to listWatch on specific type of kubernetes resource.
For higher performance, it is recommended to use the informer
instead of polling apiserver.
informer
lists/watches the apiserver and stores the resources in local cache
.ResourceEventHandler
when the add/update/delete events occur.lister
without connecting to apiserver.Clientset contains the clients for groups. Each group has exactly one version included in a Clientset.
A dynamic client that can perform generic operations on arbitrary Kubernetes API objects.