Skip to content
This repository was archived by the owner on Jul 25, 2019. It is now read-only.

Subnet allocation fixes - #227

Merged
eparis merged 5 commits into
openshift:masterfrom
danwinship:subnet-allocation
Jan 12, 2016
Merged

eparis merged 5 commits into
openshift:masterfrom
danwinship:subnet-allocation

Conversation

@danwinship

Copy link
Copy Markdown
Contributor

Given ClusterNetworkCIDR "10.1.0.0/16" and HostSubnetLength 7, the current git master algorithm would allocate subnets in the order:

  • 10.1.0.0/25
  • 10.1.0.128/25
  • 10.1.1.0/25
  • 10.1.1.128/25

and then when you see a pod IP like "10.1.0.130", you have to stop and think to figure out which node it's on. Lame!

This branch fixes it so that the allocation order becomes:

  • 10.1.0.0/25
  • 10.1.1.0/25
  • 10.1.2.0/25
  • ...
  • 10.1.255.0/25
  • 10.1.0.128/25
  • 10.1.1.128/25
  • 10.1.2.128/25
  • ...

meaning that if you have fewer than 256 nodes, then every node will have a unique 3rd octet, just like with the HostSubnetLength=8 case.

Oh, and then there's also a mostly-unrelated change to registry.go that removes the redundant validation of ClusterNetwork changes so that openshift/origin#6349 will work.

@openshift/networking

@danwinship
danwinship force-pushed the subnet-allocation branch 3 times, most recently from 6e5a274 to 832baf7 Compare December 18, 2015 14:27
@danwinship

Copy link
Copy Markdown
Contributor Author

Oh, and then there's also a mostly-unrelated change to registry.go that removes the redundant validation of ClusterNetwork changes so that openshift/origin#6349 will work.

split out into its own PR. Now this is just the subnet numbering fix

@danwinship

Copy link
Copy Markdown
Contributor Author

t.Fatalf

fixed

  hostBits uint 

can we make this uint32?

It's not a 32-bit number, it's a number from 1 to 31, so plain uint seems more appropriate. (I renamed it from "capacity" to try to make it clearer that it's "the number of bits in the address that are reserved for the host", but maybe "hostBits" isn't the best name?)

Likewise with leftShift/rightShift.

@danwinship

Copy link
Copy Markdown
Contributor Author

@pravisankar can you re-review?

@eparis

eparis commented Jan 12, 2016

Copy link
Copy Markdown
Member

[merge]

@eparis

eparis commented Jan 12, 2016

Copy link
Copy Markdown
Member

wrong tree :)

eparis added a commit that referenced this pull request Jan 12, 2016
@eparis
eparis merged commit 9655837 into openshift:master Jan 12, 2016
@danwinship
danwinship deleted the subnet-allocation branch January 12, 2016 16:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants