Skip to content
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

mDNS autoclustering #1

Merged
merged 3 commits into from
Oct 12, 2022
Merged

mDNS autoclustering #1

merged 3 commits into from
Oct 12, 2022

Conversation

masnax
Copy link
Contributor

@masnax masnax commented Oct 11, 2022

Adds a basic CLI (from microcluster) and adds hooks for auto-clustering.

When starting a daemon, we simultaneously broadcast our expected cluster address and name, while searching for join tokens from another potential peer. When we find a matching join token, we stop the mdns lookup/broadcast and join the cluster.

When bootstrapping, we will collect any currently available mdns records and create join tokens. We will then initiate a new broadcast with a map of tokens by cluster name. After 30 seconds, we will stop broadcasting this message.

Currently there's a hard limit of 30 cluster members per broadcast loop. This is because the mdns lookup uses a channel that requires a specified length for collecting results. I'll try to see if I can make this behave a bit nicer.

Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
@masnax masnax requested a review from stgraber October 11, 2022 18:13
@masnax
Copy link
Contributor Author

masnax commented Oct 11, 2022

@stgraber canonical/microcluster#37 should probably be merged first, as it might cause problems for larger clusters.

@stgraber stgraber merged commit 3932801 into canonical:main Oct 12, 2022
@stgraber
Copy link
Contributor

Merging this as-is. I'll add the initial snap packaging and do some tests on this one later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants