pod creation, node joining, etc. are triggered by using a primitive exposed by Kubernetes and the client-go called SharedInformer, inside the cache package. • Previously, each controller had its own informer cache that it would use.
producers producing items to be processed, and multiple consumers that pop these items out and process them. • This allows for “parallelizing” the work that needs to be done. • Next question is: what happens when an item is done processing?
the same item that are to be processed. How do we ensure that we process this item just once? • Due to multiple concurrent consumers, how do we prevent the same item being processed multiple times, concurrently? ◦ This is important because if we duplicate process an item - best case you end up doing additional work to rectify the mistake and worst case you have a thrashing effect of processing and retrying.
to add an element after specified duration. • Rate limiting queue ◦ It uses the delaying queue to rate limit items being added to the queue. ◦ The default rate limiter is a simple exponential rate limiter that rate limits per key. ▪ If a key had n re-queues, it will be added after 2^n * someBaseDelay back to the queue.
errors outside your business logic ◦ Handling errors typically consists of requeueing a work item. • Start workers for for processing items from workqueue only after cache is in sync successfully.