client-go under the hood

The client-go library contains various mechanisms that you can use when developing your custom controllers. These mechanisms are defined in the tools/cache folder of the library.

Here is a pictorial representation showing how the various components in the client-go library work and their interaction points with the custom controller code that you will write.

client-go components

Custom Controller components

The base controller in client-go provides the NewIndexerInformer function to create Informer and Indexer. In your code you can either directly invoke this function or use factory methods for creating an informer.