-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #58 change order of init containers to prevent zerotier races
replaces #94 There are two relevant init containers, get-zerotier-ip and wait-for-bootstrap. get-zerotier-ip used to run first. In addition to getting an ip from zerotier, get-zerotier-ip also downloads all interfaces for the config generator to generate a list of bootstrap ips. When get-zerotier-ip runs first, it may download this list before the bootstrap node has registered its ip as a bootstrap ip, sometimes causing a race condition where the non-bootstrap nodes do not have a bootstrap ip configured. With this PR, wait-for-bootstrap comes first. It waits for bootstrap node to be up (by probing it internally, not through zerotier). Only then will it create an ip and download the bootstrap peer ip from zerotier. Since at this point the init container for the bootstrap node has already ran, the bootstrap ip will for sure be registered in zerotier. I tried several times in zerotier and non zerotier modes, it always works for me. See PR 94 for a better explanation. Also make the zerotier script fail on error, so any error with zerotier api will fail the pod and trigger a retry.
- Loading branch information
1 parent
f4aa12e
commit 908ca91
Showing
3 changed files
with
61 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters