flannel-io / flannel

flannel is a network fabric for containers, designed for Kubernetes
Apache License 2.0
8.6k stars 2.87k forks source link

Try several times to contact kube-api before failing #1977

Closed manuelbuil closed 1 month ago

manuelbuil commented 1 month ago

Description

When the code tries to get a lease, it contacts kube-api. If dor some reason, the connectivity failed, flanneld will error out and the registration of the network will fail. This PR makes it try several times before really failing so that we can be more resilient.

This PR also replaces some wait.Poll() calls. That one is deprecated

Todos

Release Note

Retry contacting kube-api when acquiring a lease if it fails