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

resolve the bug when cluster CIDR is not /8 #19580

Merged
merged 1 commit into from
Jan 21, 2016

Conversation

WeixuZhuang
Copy link
Contributor

Ref #17754

We will have the rigth formula to generate correct maxCIDRs now.
Previous code assume cluster CIDR is /8 which may not be true.
Now it generates maxCIDR based on the info of cluster IP.

@k8s-bot
Copy link

k8s-bot commented Jan 13, 2016

Can one of the admins verify that this patch is reasonable to test? (reply "ok to test", or if you trust the user, reply "add to whitelist")

If this message is too spammy, please complain to ixdy.

1 similar comment
@k8s-bot
Copy link

k8s-bot commented Jan 13, 2016

Can one of the admins verify that this patch is reasonable to test? (reply "ok to test", or if you trust the user, reply "add to whitelist")

If this message is too spammy, please complain to ixdy.

@k8s-github-robot
Copy link

Labelling this PR as size/XS

@WeixuZhuang
Copy link
Contributor Author

@therc , @gmarek

@gmarek gmarek assigned gmarek and unassigned derekwaynecarr Jan 13, 2016

cidrSize, _ := nc.clusterCIDR.Mask.Size()

// nc.maxCIDRs = int(math.Mod((256-cidr[0])*2^24 + (256-cidr[1])*2^16 + (256-cidr[2])*2^8, 2^(32-cidrSize)) / (2^8))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really get a reasoning for this formula. Isn't it 2^(24 - cidrSize) assuming that clusterCIDR is valid, i.e. (IP & ~Mask == 0)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the old code let you allocate subnets from some point in the middle of the CIDR and only go forward, which might be neat for some, but does not really meet the established definition of which range CIDR notation represents exactly. :-) I'm assuming this was an attempt to replicate that non-standard behaviour. #19242 is the way to go, as it does things the proper way and supports non-/24 pod allocations.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic itself is short, so instead of going nuclear with #19242 we should fix the logic here if needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i could fix it and just make it simple as 2^(24 - cidrSize)

Thanks

@mqliang
Copy link
Contributor

mqliang commented Jan 13, 2016

see #19242

@gmarek
Copy link
Contributor

gmarek commented Jan 13, 2016

@mqliang - too bad I wasn't aware of your work. By the quick look it seems to be similar to the first version of @WeixuZhuang PR.

@gmarek
Copy link
Contributor

gmarek commented Jan 13, 2016

LGTM
@therc - is this change enough for your case?

We will have the rigth formula to generate correct maxCIDRs now.
Previous code assume cluster CIDR is /8 which may not be true.
Now it generates maxCIDR based on the info of cluster IP.
@therc
Copy link
Member

therc commented Jan 13, 2016

That would be enough, I have something very similar working on my setup. Thanks!

@gmarek
Copy link
Contributor

gmarek commented Jan 14, 2016

ok to test

@k8s-bot
Copy link

k8s-bot commented Jan 14, 2016

GCE e2e test build/test passed for commit 2af68d2.

@k8s-github-robot
Copy link

The author of this PR is not in the whitelist for merge, can one of the admins add the 'ok-to-merge' label?

@gmarek gmarek added lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-merge labels Jan 14, 2016
@k8s-github-robot
Copy link

@k8s-bot test this

Tests are more than 48 hours old. Re-running tests.

@k8s-bot
Copy link

k8s-bot commented Jan 16, 2016

GCE e2e build/test failed for commit 2af68d2.

@WeixuZhuang
Copy link
Contributor Author

Hi, may I know why this PR has not get merged?

Thanks

@gmarek
Copy link
Contributor

gmarek commented Jan 18, 2016

It's a flake.

@k8s-bot test this.

@gmarek
Copy link
Contributor

gmarek commented Jan 18, 2016

Plus merge queue is currently blocked as we had some regression during the weekend. I'm looking into it now.

@k8s-bot
Copy link

k8s-bot commented Jan 18, 2016

GCE e2e test build/test passed for commit 2af68d2.

@k8s-github-robot
Copy link

@k8s-bot test this

Tests are more than 48 hours old. Re-running tests.

@k8s-bot
Copy link

k8s-bot commented Jan 20, 2016

GCE e2e test build/test passed for commit 2af68d2.

alex-mohr added a commit that referenced this pull request Jan 21, 2016
resolve the bug when cluster CIDR is not /8
@alex-mohr alex-mohr merged commit 94b2490 into kubernetes:master Jan 21, 2016
davidopp pushed a commit to davidopp/kubernetes that referenced this pull request Jan 26, 2016
brendandburns added a commit that referenced this pull request Jan 26, 2016
openshift-publish-robot pushed a commit to openshift/kubernetes that referenced this pull request May 2, 2018
UPSTREAM: 63321: kubelet: force filterContainerID to empty string when removeAll is true

Origin-commit: 81f11178a4b644a95f3d8c489509648e9152e5e5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants