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

[release-1.21] Fix URL pruning when joining an etcd member #3840

Merged
merged 1 commit into from
Aug 13, 2021

Conversation

brandond
Copy link
Member

Problem:
Existing member clientURLs were checked if they contain the joining
node's IP. In some edge cases this would prune valid URLs when the
joining IP is a substring match of the only existing member's IP.
Because of this, it was impossible to e.g. join 10.0.0.2 to an existing
node that has an IP of 10.0.0.2X or 10.0.0.2XX:

level=fatal msg="starting kubernetes: preparing server: start managed database:
joining etcd cluster: etcdclient: no available endpoints"

Solution:
Fixed by properly parsing the URLs and comparing the IPs for equality
instead of substring match.

Signed-off-by: Malte Starostik [email protected]

Proposed Changes

When joining an etcd node, only discard an existing node's clientURL if it's strictly the same address as opposed to a substring match.

Types of Changes

Bugfix

Verification

Try to join (etcd role) 10.0.0.2 to --cluster-init'ed node with 10.0.0.255

Linked Issues

User-Facing Change

NONE

Further Comments

N/A

@brandond brandond requested a review from a team as a code owner August 12, 2021 23:02
* Fix URL pruning when joining an etcd member

Problem:
Existing member clientURLs were checked if they contain the joining
node's IP. In some edge cases this would prune valid URLs when the
joining IP is a substring match of the only existing member's IP.
Because of this, it was impossible to e.g. join 10.0.0.2 to an existing
node that has an IP of 10.0.0.2X or 10.0.0.2XX:

level=fatal msg="starting kubernetes: preparing server: start managed database:
joining etcd cluster: etcdclient: no available endpoints"

Solution:
Fixed by properly parsing the URLs and comparing the IPs for equality
instead of substring match.

Signed-off-by: Malte Starostik <[email protected]>
(cherry picked from commit b23955e)
Signed-off-by: Brad Davidson <[email protected]>
@brandond brandond force-pushed the fix_3831_release-1.21 branch from 2deee8c to 1e70e4d Compare August 12, 2021 23:18
@brandond brandond merged commit e45726f into k3s-io:release-1.21 Aug 13, 2021
@brandond brandond deleted the fix_3831_release-1.21 branch June 6, 2024 21:18
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.

3 participants