-
Notifications
You must be signed in to change notification settings - Fork 130
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
DualStack Proposal #237
DualStack Proposal #237
Conversation
Signed-off-by: Ayush Patel <[email protected]>
"mode": "bridge", | ||
"ipam": { | ||
"type": "whereabouts", | ||
- "range": "192.168.2.225/28", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we both want to keep this for backwards compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops, I see this is one example, I see that other keeps this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes :)
doc/proposals/dualstack.md
Outdated
Type string `json:"type"` | ||
Routes []*cnitypes.Route `json:"routes"` | ||
Datastore string `json:"datastore"` | ||
+ IPs []IPConfig `json:"ips"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name ideas:
- IPRanges
- IPConfigs
- IPAliases
- IPCIDRs
- CIDRs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would go for IPRanges
. And name the attribute type RangeConfiguration
or range config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RangeConfiguration
++
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this proposal.
I'd like to actually congratulate you on the focus on the changes from the current API, and how easy you made it for us to understand them. Kudos.
I am OK with pretty much everything you wrote, but still pointed a couple of nits.
doc/proposals/dualstack.md
Outdated
|
||
<hr> | ||
|
||
## Introduction <a name="introduction"></a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this <a name="introduction"></a>
redundant in markdown ? AFAIU, there's an implicit anchor after the lowercase, dash separated, name of the heading. In this case - introduction.
doc/proposals/dualstack.md
Outdated
This is a design proposal document for introducing IPv4/IPv6 DualStack support in whereabouts. | ||
|
||
|
||
### Goal <a name="goal"></a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same; goal
can be used directly without specifying the anchor name.
doc/proposals/dualstack.md
Outdated
|
||
<hr> | ||
|
||
## Design <a name="design"></a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
doc/proposals/dualstack.md
Outdated
|
||
Basically, rather than having IP related configurations directly as key members of `IPAMConfig` object, they be included as element of an object type, let's say `IPConfig` and `IPAMConfig` should have an array of `IPConfig` as it's element. | ||
|
||
### Changes in IPAM Config <a name="configChanges"></a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here it makes sense - assuming you don't want to use the implicit changes-in-ipam-config
anchor name.
doc/proposals/dualstack.md
Outdated
"mode": "bridge", | ||
"ipam": { | ||
"type": "whereabouts", | ||
"ips": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto. I would name this ranges
instead.
doc/proposals/dualstack.md
Outdated
|
||
```diff | ||
|
||
+type IPConfig struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RangeConfiguration
?
doc/proposals/dualstack.md
Outdated
Type string `json:"type"` | ||
Routes []*cnitypes.Route `json:"routes"` | ||
Datastore string `json:"datastore"` | ||
+ IPs []IPConfig `json:"ips"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would go for IPRanges
. And name the attribute type RangeConfiguration
or range config.
"exclude": [ | ||
"192.168.2.229/30", | ||
"192.168.2.236/32", | ||
+ "2001::0/124" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how would you map the entries on the exclusion list to the correct range ? Here it actually seems doable since the ranges are from different IP families, but, what if you want to use this feature to configure multiple IPs in the same interface ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can take separate unions of IPv4 and IPv6 excluded ranges and just skip the IPs that belongs to that union set/list :)
I don't think we need to map it to the exact range. ^^
First approach requires addition on a new _type_ for encapsulating all the IP related information on `IPAMConfig` and requires significant amount of change in the current code. But with this additional effort, it will have additional benefit of allowing us to allocate as many as we required IP addresses of any IP family without any constraints. _(We need to support the existing fields too for backward compatibility)_ | ||
|
||
Second approach is somewhat simpler. It just adds some additional fields for _secondary_ IP address related configuration (which might be IPv4 or IPv6 depending on stack policy). The downside is that we will limit ourselves to adding at max 2 IP address for a pod. _(TBH, it also seems okay for now, but I prefer the first approach)_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the analysis presented here: first approach is preferable - simply because the second one does not scale.
Furthermore, the IP is somewhat clunky IMO.
I vote for option 1 as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a paragraph to the summary
indicating what is the chosen option and why.
Pull Request Test Coverage Report for Build 2462334462Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
- Updated attribute and struct name as per discussion - Minor formatting in proposal document
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nearly there.
Are you ready to propose a test plan for the feature, or would you prefer to do so later on ?
I suggest you never the less familiarize yourself with the e2e tests we have; imo, you would add a new test suite there.
doc/proposals/dualstack.md
Outdated
|
||
Basically, rather than having IP related configurations directly as key members of `IPAMConfig` object, they be included as element of an object type, let's say `IPConfig` and `IPAMConfig` should have an array of `IPConfig` as it's element. | ||
Rather than having IP related configurations directly as key members of `IPAMConfig` object, the IP configuration would be wrapped in a new struct - let's say `IPConfig`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than having IP related configurations directly as key members of `IPAMConfig` object, the IP configuration would be wrapped in a new struct - let's say `IPConfig`. | |
Rather than having IP related configurations directly as key members of `IPAMConfig` object, the IP configuration would be wrapped in a new struct - let's say `RangeConfiguration`. |
First approach requires addition on a new _type_ for encapsulating all the IP related information on `IPAMConfig` and requires significant amount of change in the current code. But with this additional effort, it will have additional benefit of allowing us to allocate as many as we required IP addresses of any IP family without any constraints. _(We need to support the existing fields too for backward compatibility)_ | ||
|
||
Second approach is somewhat simpler. It just adds some additional fields for _secondary_ IP address related configuration (which might be IPv4 or IPv6 depending on stack policy). The downside is that we will limit ourselves to adding at max 2 IP address for a pod. _(TBH, it also seems okay for now, but I prefer the first approach)_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a paragraph to the summary
indicating what is the chosen option and why.
Thank you for your comments.
I'm planning to do it latter along with the development :)
Thank you for you guidance :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a question about the proposed alternative: how do the new RangesConfiguration
slice play along w/ the old Range
attribute ? Is the behavior additive (i.e. 1 range + 2 entries in the RangeConfiguration
results in 3 configured interfaces) ?
I would like to see a sub-section about this, explaining (w/ a couple of examples) how it would works.
Some alternatives for this I see:
- additive behavior (described above)
- only use the new range configuration array / slice (the old
Range
would be just used for reading - i.e. copy the first range from the array there) - if
Range
is provided, disallow multiple ranges
@maiqueb As you described, when both old configuration and I have added a section for the same along with examples in the proposal. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for providing the examples - your proposal is now - imo - crystal clear.
I'll let this soak for a few weeks to give the community the time to also provide feedback / @dougbtv to back it up, but, I think you can start implementing this as is.
Good work.
Thanks @maiqueb :) |
Take your time, no rush. Feel free to reach out if you need help with the e2e tests. |
We fully support this initiative to let whereabouts assign IP addresses from multiple IP ranges (IPv4 and/or v6) to a secondary pod interface and agree with the proposed implementation. |
@dougbtv Hi, can we merge this proposal ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks Ayush for the proposal, looking forward to the functionality.
all, which release will support this feature? seems now only master has these code support. Thanks |
Thanks @ryanlyy -- we have published https://github.com/k8snetworkplumbingwg/whereabouts/releases/tag/v0.6 -- including this feature! |
@dougbtv thank you! |
Hi @Ayush21298 does this only support macvlan mode? looking at the test, only macvlan is tested. |
Proposal
Brief Design Proposal for IPv4/IPv6 DualStack support.
Checklist
I wasn't sure about the proposal format being used for the project, so if anything is missing please add it in the checklist :)
Related Issue
Dual Stack Support