• Kubernetes Submit Queue's avatar
    Merge pull request #48737 from mattmoyer/faster-kubeadm-join · 7d97208e
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue
    
    kubeadm: begin polling for bootstrap cluster info immediately
    
    **What this PR does / why we need it**:
    This PR changes the behavior of the `kubeadm` loop that polls the API server waiting for discovery information (`cluster-info`). The previous (inadvertent?) behavior was to sleep for `constants.DiscoveryRetryInterval` (5 seconds) before the first request ([`PollInfinite`](https://godoc.org/k8s.io/apimachinery/pkg/util/wait#PollInfinite) vs. [`PollImmediateInfinite`](https://godoc.org/k8s.io/apimachinery/pkg/util/wait#PollImmediateInfinite)).
    
    After this change, `kubeadm` begins does the first check immediately before it moves into the slower polling mode. This takes around 5 seconds off the average time for a new node to join.
    
    #### Before (~5.5s)
    ```
    root@worker:~# time kubeadm join --token abc.123 192.168.42.10:6443
    [...]
    real	0m5.523s
    user	0m0.112s
    sys	0m0.124s
    ```
    
    #### After (~0.5s)
    ```
    root@worker:~# time kubeadm join --token abc.123 192.168.42.10:6443
    [...]
    real	0m0.587s
    user	0m0.092s
    sys	0m0.132s
    ```
    
    **Which issue this PR fixes**:
    
    **Special notes for your reviewer**:
    This is my first Kubernetes PR, so please let me know if it's formatted correctly.
    
    **Release note**:
    
    ```release-note
    NONE
    ```
    7d97208e
Name
Last commit
Last update
..
clicheck Loading commit data...
cloud-controller-manager Loading commit data...
gendocs Loading commit data...
genkubedocs Loading commit data...
genman Loading commit data...
genslateyaml Loading commit data...
genswaggertypedocs Loading commit data...
genutils Loading commit data...
genyaml Loading commit data...
gke-certificates-controller Loading commit data...
hyperkube Loading commit data...
kube-apiserver Loading commit data...
kube-controller-manager Loading commit data...
kube-proxy Loading commit data...
kubeadm Loading commit data...
kubectl Loading commit data...
kubelet Loading commit data...
kubemark Loading commit data...
libs/go2idl Loading commit data...
linkcheck Loading commit data...
mungedocs Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...