kubernetes-ingress-controller
kubernetes-ingress-controller copied to clipboard
Make a new snapshot of the store only when it differs from previous snapshot
Making a snapshot of the Kubernetes store store.Storer
may be expensive, especially for large configs also it impacts the memory footprint of KIC, thus do it only when it differs from the previous one.
Calculate the hash from all objects in a store and compare it with a hash preserved for the currently used snapshot.
An instance of an object (resource) in K8s can be uniquely identified by one of the below:
- UID
- a combination of
Kind
,Namespace
(for namespace resources),Name
(API version is irrelevant)
so one of the above has to be included alongside resourceVersion that makes change tracking possible.
For actual implementation worth checking library is hashstructure