-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default network readiness enhancement #98
Default network readiness enhancement #98
Conversation
e2026a9
to
7d3e968
Compare
@rkamudhan -- do you have a suggestion for a retry library to use? I looked into using the one you had used for the annotation re-try, but, apparently it seems to be for conflicting writes, or at least that's what I found looking at this method: https://github.com/kubernetes/client-go/blob/master/util/retry/util.go#L45-L47 I have a rebase, but, I don't have a refactor here yet. |
Note to self: spec updated to say "not a default 2 minute wait" -- we'll just have an exponential back-off, and keep on running. |
|
multus/multus.go
Outdated
// is present (or until a user-defined timeout is reached) | ||
func waitForDefaultNetwork(indicatorFile string, waitSeconds int) error { | ||
// If there's no file to wait for, then, this is essentially disabled. | ||
if len(indicatorFile) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use https://godoc.org/k8s.io/apimachinery/pkg/util/wait backoff here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet! Kural thank you for the suggestion, and the awesome code example -- really appreciated.
Thanks again on input for the wait library in apimachinery. Happy to take any input on the default backoff parameters, and also if any should be exposed in the configurations. |
yes yes. We can take backoff time from user as well.. But it is advance feature, we can do it later.. no issues.. |
04201ce
to
b7d092a
Compare
types/conf.go
Outdated
@@ -179,6 +180,10 @@ func LoadNetConf(bytes []byte) (*NetConf, error) { | |||
netconf.BinDir = defaultBinDir | |||
} | |||
|
|||
if netconf.DefaultNetworkFile == "" { | |||
netconf.DefaultNetworkFile = defaultDefaultNetworkFile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dougbtv how the delegate information is transferred from the default file to RawDelegates ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have defaultNetworkFile, then the delegate is not a must right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR is WIP
multus/multus.go
Outdated
var defaultReadinessBackoff = wait.Backoff{ | ||
Steps: 4, | ||
Duration: 10 * time.Millisecond, | ||
Factor: 5.0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idea is to set 250 millis, and factor of 4, for .25 seconds, 1 second, 4 second, 16 secons....
b7d092a
to
572c64f
Compare
Latest commit pushed has decided on back off. |
rename |
e961722
to
6cb2e8c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, Doug! Thank you for your update!
Idea: We run this as a startup option -- that is, this happens to look for a file (or CRD object) before Multus runs, so you say run multus as |
6cb2e8c
to
4a5d26c
Compare
@s1061123 -- give this a look, I have it rebased to fix up the conflicts! Thanks for letting me know about it. |
Pull Request Test Coverage Report for Build 416
💛 - Coveralls |
@dougbtv , done! Thank you for your long-time work! |
Uses the alternate network readiness methodology, section 6.1.1 of the de-facto standard.
In short:
This method waits in a loop for 2 minutes (by default) looking for a configuration file from the default network and is otherwise configurable (e.g. for which default network configuration file to look for an for the timeout length).
More details available in
README.md
changes.