• Kubernetes Submit Queue's avatar
    Merge pull request #63492 from liggitt/node-heartbeat-close-connections · 8220171d
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
    
    track/close kubelet->API connections on heartbeat failure
    
    xref #48638
    xref https://github.com/kubernetes-incubator/kube-aws/issues/598
    
    we're already typically tracking kubelet -> API connections and have the ability to force close them as part of client cert rotation. if we do that tracking unconditionally, we gain the ability to also force close connections on heartbeat failure as well. it's a big hammer (means reestablishing pod watches, etc), but so is having all your pods evicted because you didn't heartbeat.
    
    this intentionally does minimal refactoring/extraction of the cert connection tracking transport in case we want to backport this
    
    * first commit unconditionally sets up the connection-tracking dialer, and moves all the cert management logic inside an if-block that gets skipped if no certificate manager is provided (view with whitespace ignored to see what actually changed)
    * second commit plumbs the connection-closing function to the heartbeat loop and calls it on repeated failures
    
    follow-ups:
    * consider backporting this to 1.10, 1.9, 1.8
    * refactor the connection managing dialer to not be so tightly bound to the client certificate management
    
    /sig node
    /sig api-machinery
    
    ```release-note
    kubelet: fix hangs in updating Node status after network interruptions/changes between the kubelet and API server
    ```
    8220171d
Name
Last commit
Last update
..
app Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...
kubelet.go Loading commit data...