Informer机制
kube-controller-manager源码分析(三)之 Informer机制
cache
├── controller.go # 包含:Config、Run、processLoop、NewInformer、NewIndexerInformer
├── delta_fifo.go # 包含:NewDeltaFIFO、DeltaFIFO、AddIfNotPresent
├── expiration_cache.go
├── expiration_cache_fakes.go
├── fake_custom_store.go
├── fifo.go # 包含:Queue、FIFO、NewFIFO
├── heap.go
├── index.go # 包含:Indexer、MetaNamespaceIndexFunc
├── listers.go
├── listwatch.go # 包含:ListerWatcher、ListWatch、List、Watch
├── mutation_cache.go
├── mutation_detector.go
├── reflector.go # 包含:Reflector、NewReflector、Run、ListAndWatch
├── reflector_metrics.go
├── shared_informer.go # 包含:NewSharedInformer、WaitForCacheSync、Run、HasSynced
├── store.go # 包含:Store、MetaNamespaceKeyFunc、SplitMetaNamespaceKey
├── testing
│ ├── fake_controller_source.go
├── thread_safe_store.go # 包含:ThreadSafeStore、threadSafeMap
├── undelta_store.go0. 原理示意图
0.1. client-go组件
0.2. 自定义controller组件
1. sharedInformerFactory.Start
2. sharedIndexInformer.Run
2.1. NewDeltaFIFO
2.2. Config
2.3. controller
2.4. cacheMutationDetector.Run
2.5. processor.run
2.6. controller.Run
3. Reflector
3.1. Reflector
3.2. NewReflector
3.3. Reflector.Run
3.4. ListAndWatch
3.4.1. List
3.4.2. store.Resync
3.4.3. Watch
3.4.4. watchHandler
4. DeltaFIFO
4.1. NewDeltaFIFO
4.2. DeltaFIFO
4.3. Queue & Store
5. store
6.1. cache
6.2. ThreadSafeStore
6. processLoop
5.1. DeltaFIFO.Pop
5.2. HandleDeltas
5.3. sharedProcessor.distribute
7. processor
7.1. sharedProcessor.Run
7.1.1. listener.pop
7.1.2. listener.run
7.2. ResourceEventHandler
7.2.1. addDeployment
8. 总结
8.1. Reflector
8.2. ListAndWatch
8.3. DeltaFIFO
8.4. store
8.5. processor
8.6. 主要步骤
最后更新于

