When a Kubernetes service is created, which one among these watchers is called first 'kube proxy' or 'a custom watcher'

1/5/2018

I have a custom watcher as follows:

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's kube-proxy also listens for service events using informers. Is it always guaranteed that kube-proxy's handler's are called before the custom watcher gets the call?

-- Pradeep
kube-proxy
kubernetes

1 Answer

1/5/2018

Is it always guaranteed that kube-proxy's handler's are called before the custom watcher gets the call?

No, both kube-proxy and the custom watcher are treated as normal API clients, and there is no "happens before" guarantee as to which receives the service event first.

-- Jordan Liggitt
Source: StackOverflow