Closed thiyyakat closed 1 month ago
Thank you @thiyyakat for your contribution. Before I can start building your PR, a member of the organization must set the required label(s) {'reviewed/ok-to-test'}. Once started, you can check the build status in the PR checks section below.
What this PR does / why we need it:
The PR changes the way pods are listed before eviction, by using a
PodInformer
which uses a local cache rather than directly querying the kube-apiserver/etcd. The pods are listed only after the cache has synced.Which issue(s) this PR fixes: Fixes #703
Special notes for your reviewer:
Impact of changes tested by running pods configuring a PDB with
maxUnavailable
set to 0, on a cluster with 20 machines, and deleting all the machines, thereby initiating drain. Without change, peak traffic recorded was 8.51 MB/s. With change, peak traffic recorded was 1.48 MB/s.Integration tests run for providers AWS and Azure completed successfully.
Additionally, to manually check if cache for
podInformer
syncs successfully before thepodLister.List()
call,time.Sleep( 30 * time.Second)
was introduced before callingRunCordonOrUncordon()
, and a new pod (default/nginx-pod2 ) was deployed during the sleep period. Logs were added to print the names of all pods on the node returned by the podLister. After triggering the deletion of the machine, the machine entered the drain flow, and after the sleep the new pod's name was logged.Release note: