This PR improves upon my last one that included the Kubernetes service discovery mechanism.
Originally, I used a simple Watch, but this can lead to changes not being tracked anymore after a while, because the watcher has no builtin mechanism to recover stalled or lost connections to the Kubernetes API server and just silently receives no more updates.
The Kubernetes Informer factory instead is built on top of the Watch mechanism with exactly those issues in mind in that it does an automatic re-list and re-watch to recover from any closed connections (due to network errors or the Kubernetes API server being restarted, etc...).
This PR improves upon my last one that included the Kubernetes service discovery mechanism.
Originally, I used a simple Watch, but this can lead to changes not being tracked anymore after a while, because the watcher has no builtin mechanism to recover stalled or lost connections to the Kubernetes API server and just silently receives no more updates.
The Kubernetes Informer factory instead is built on top of the Watch mechanism with exactly those issues in mind in that it does an automatic re-list and re-watch to recover from any closed connections (due to network errors or the Kubernetes API server being restarted, etc...).
(See also https://github.com/kubernetes-client/javascript/issues/377 - this is about the JavaScript SDK, but the underlying mechanisms are the same in the Go Client SDK).