当创建一个 Kubernetes 服务时,这些 watcher 中哪个先被调用 'kube proxy' 或 'a custom watcher'
When a Kubernetes service is created, which one among these watchers is called first 'kube proxy' or 'a custom watcher'
我有一个自定义观察者如下:
watchlist := cache.NewListWatchFromClient(client.Core().RESTClient(), "configmaps", KubeSystemNameSpace, fields.SelectorFromSet(fields.Set{"metadata.name": "test-map"}))
resyncPeriod := 30 * time.Minute
//Setup an informer to call functions when the watchlist changes
_, controller = cache.NewInformer(
watchlist,
&v1.ConfigMap{},
resyncPeriod,
cache.ResourceEventHandlerFuncs{
UpdateFunc: configMapUpdated,
},
)
Kubernetes 的 kube-proxy 也使用 informers 监听服务事件。是否始终保证在自定义观察者收到调用之前调用 kube-proxy 的处理程序?
Is it always guaranteed that kube-proxy's handler's are called before the custom watcher gets the call?
不,kube-proxy 和自定义观察器都被视为普通 API 客户端,并且没有 "happens before" 保证哪个先接收到服务事件。
我有一个自定义观察者如下:
watchlist := cache.NewListWatchFromClient(client.Core().RESTClient(), "configmaps", KubeSystemNameSpace, fields.SelectorFromSet(fields.Set{"metadata.name": "test-map"}))
resyncPeriod := 30 * time.Minute
//Setup an informer to call functions when the watchlist changes
_, controller = cache.NewInformer(
watchlist,
&v1.ConfigMap{},
resyncPeriod,
cache.ResourceEventHandlerFuncs{
UpdateFunc: configMapUpdated,
},
)
Kubernetes 的 kube-proxy 也使用 informers 监听服务事件。是否始终保证在自定义观察者收到调用之前调用 kube-proxy 的处理程序?
Is it always guaranteed that kube-proxy's handler's are called before the custom watcher gets the call?
不,kube-proxy 和自定义观察器都被视为普通 API 客户端,并且没有 "happens before" 保证哪个先接收到服务事件。