-
Notifications
You must be signed in to change notification settings - Fork 797
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
Windows CNI support #193
Windows CNI support #193
Conversation
build script: |
7dc47ba
to
578b32b
Compare
LGTM 👍 |
ok, so this isn't so much a patch on top of #85, just a replacement for it. we'd just merge this one and close that one. When we merge, we can fix-up the middle commit to include the original authors (@rakelkar and @madhanrm) as Edit: Here's a branch with the same contents as this PR, but with commit messages slightly fixed up, giving credit to original authors: master...rosenhouse:gabe-windows-cleanup |
LGTM |
Good suggestion by @squeed: we could add an |
LGTM
So exciting to see this getting merged finally!
…-r
On Wed, Aug 29, 2018, 8:12 AM Gabe Rosenhouse ***@***.***> wrote:
Good suggestion by @squeed <https://github.com/squeed>: we could add an
authors or maintainers file here listing the Microsoft folks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#193 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADQpheSZPow9Yy9OSgHJJbp8Bsj6dAHeks5uVq90gaJpZM4WI7iv>
.
|
@rosenhouse, fix a mistake from #85 (comment). FYI, @benmoss . |
d82e0a3
to
ea2c3b6
Compare
LGTM |
We have subsequent PR's waiting on this merge. Can we please get this in as all our remaining work is gates on this PR? |
Will need a second approval from one of the @containernetworking/cni-maintainers before we can merge. |
@squeed any chance you can take a look? |
Thank you @rosenhouse for the support and assistance in this PR and your review 🥇 |
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.
There are a number of review comments that we'd like addressed, but looks like this is on the right track. Thanks!
pkg/hns/netconf.go
Outdated
// NetConf is the CNI spec | ||
type NetConf struct { | ||
types.NetConf | ||
AdditionalArgs []policyArgument `json:"AdditionalArgs,omitempty"` |
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.
Need to fix the JSON capitalization:
json:"additionalArgs,omitempty"
types.CommonArgs | ||
K8S_POD_NAMESPACE types.UnmarshallableString `json:"K8S_POD_NAMESPACE,omitempty"` | ||
K8S_POD_NAME types.UnmarshallableString `json:"K8S_POD_NAME,omitempty"` | ||
K8S_POD_INFRA_CONTAINER_ID types.UnmarshallableString `json:"K8S_POD_INFRA_CONTAINER_ID,omitempty"` |
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.
INFRA_CONTAINER_ID isn't used anywhere, so it should be removed.
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 for K8S_POD_NAME
types.CommonArgs | ||
K8S_POD_NAMESPACE types.UnmarshallableString `json:"K8S_POD_NAMESPACE,omitempty"` | ||
K8S_POD_NAME types.UnmarshallableString `json:"K8S_POD_NAME,omitempty"` | ||
K8S_POD_INFRA_CONTAINER_ID types.UnmarshallableString `json:"K8S_POD_INFRA_CONTAINER_ID,omitempty"` |
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.
INFRA_POD_CONTAINER_ID isn't used anywhere so it should be removed.
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 for K8S_POD_NAME
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.
Actually per below, let's remove all the CNI Args stuff for now.
|
||
ipAddr := result.IPs[0].Address.IP.To4() | ||
// conjure a MAC based on the IP for Overlay | ||
macAddr := fmt.Sprintf("%v-%02x-%02x-%02x-%02x", n.endpointMacPrefix, ipAddr[0], ipAddr[1], ipAddr[2], ipAddr[3]) |
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.
This plugin isn't IPv6-ready, is it? That could be a blocker, since all the rest of the CNI Plugins work with IPv6.
cniargs, err := parseCniArgs(args.Args) | ||
k8sNamespace := "default" | ||
if err == nil { | ||
k8sNamespace = string(cniargs.K8S_POD_NAMESPACE) |
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.
This is Kubernetes specific, which isn't something we want in CNI since CNI is not Kubernetes-specific and works with other runtimes too. For Kube I believe there are some other solutions that we can explore that don't hardcode Kube-ness into the CNI plugin.
For now, let's remove all the parseCniArgs() and K8S_POD_NAMESPACE stuff and fix that in a follow-up patch.
``` | ||
{ | ||
"name": "mynet", | ||
"type": "win-l2bridge", |
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.
Need to make the type consistent with the actual plugin name, eg when renamed to "win-bridge" need to make this "type": "win-bridge",
## Network configuration reference | ||
|
||
* `name` (string, required): the name of the network. | ||
* `type` (string, required): "win-l2bridge". |
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.
Need to keep the plugin name consistent with the binary name.
plugins/meta/flannel/README.md
Outdated
|
||
The following fields must be set in the delegated plugin configuration: | ||
* `name` (string, required): the name of the network (must match the name in Flannel config / name of the HNS network) | ||
* `type` (string, optional): set to win-l2bridge by default. Can be set to win-overlay or other custom windows CNI |
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.
Need to keep the plugin name consistent with the binary name.
@@ -0,0 +1,27 @@ | |||
# L2Bridge plugin (Windows) |
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.
This is for the Overlay plugin, right? Not L2Bridge.
``` | ||
{ | ||
"name": "mynet", | ||
"type": "win-overlay", |
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.
Need to keep the type consistent with the binary name, and to match win-bridge, let's rename the binary to "win-overlay".
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 this is ok to go in; the main eyebrow-raising points have been addressed.
098544b
to
dac2261
Compare
3b64a83
to
cfc87a0
Compare
@rosenhouse , @dcbw , @squeed , @bboreham , is there any new questions on this PR? |
Changes look good to me, thanks! One last request - could you squash your commits in to one for /vendor and one for everything else? |
1125448
to
915374c
Compare
(*) github.com/Microsoft/hcsshim (*) golang.org/x/sys (*) github.com/x/cyrpto (*) github.com/sirupsen/logrus (*) github.com/Microsoft/go-winio (*) github.com/juju/errors (*) github.com/buger/jsonparser
Patch for containernetworking#85 + Windows cni plugins are added (*) win-bridge (hostgw) (*) win-overlay (vxlan) + Windows netconf unit test + Fix appveyor config to run the test + Build release support for windows plugins Address comments From: - containernetworking#85 - rakelkar@0049c64
915374c
to
b56ca2f
Compare
LGTM, I think the remaining issues can be addressed in follow-up PRs |
A patch PR for #85