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

Enable Flannel to support Windows for host-gw and VXLAN #832

Closed
wants to merge 5 commits into from

Conversation

rakelkar
Copy link
Contributor

@rakelkar rakelkar commented Oct 4, 2017

Description

This PR enables Flannel to build and run on windows and support configuring Kubernetes using the host-gw and VXLAN backend. The goal is to enable users to provision a Kubernetes cluster with windows nodes in VXLAN mode or mixed windows and Linux nodes in host-gw mode.

The change requires a related change to the Flannel CNI to enable it to delegate to Windows CNI.
PRs open on CNI:
flannel CNI for windows: containernetworking/plugins#76
host-local IPAM for windows: containernetworking/plugins#77

Todos

  • Tests
  • Documentation

rakelkar and others added 2 commits October 4, 2017 17:34
This change is the first required step to supporting flannel on Windows
This uses new Windows Host Networking Service (HNS) features to
configure networking for the host-gw mode

Fixes flannel-io#833
Copy link
Contributor

@tomdee tomdee left a comment

Choose a reason for hiding this comment

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

Thanks for this PR. I've taken a look and it's looking broadly OK, though I do have a few questions/comments.

  • Common code
    What are your thoughts on all the duplicate code in hostgw_*.go? The Windows and Linux versions share quite a bit of code, do you think it should be pulled out?
  • Testing
    How will the flannel.exe binary be automatically tested? TravisCI doesn't support windows so we need some alternative.
    You'll need to add some windows specific tests before this can be merged.
  • Maintenance
    Who is going to be responsible for ongoing maintenance for Windows support in flannel? I am likely going to need help in this area since I don't have a Windows computer. I'm thinking of things like Windows specific test failing, reviewing Windows specific PR and providing Windows support.
  • Documentation
    This PR will need to include some Windows specific documentation
  • Build
    This PR will need to include some way of building and releasing the Windows flannel binary

Also, you shouldn't have added logrus as a submodule in vendor. If you need it to be updated you should do it through glide.

"github.com/coreos/flannel/backend"
"github.com/coreos/flannel/subnet"

netroute "github.com/rakelkar/gonetsh/netroute"
Copy link
Contributor

Choose a reason for hiding this comment

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

This will need to be added to the glide.* files

import (
"fmt"

"github.com/Microsoft/hcsshim"
Copy link
Contributor

Choose a reason for hiding this comment

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

this will also need to be added to glide

@@ -0,0 +1,25 @@
// +build windows
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need this file since vxlan isn't currently supported on Windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Merged VXLAN support

@@ -0,0 +1,34 @@
// +build windows
Copy link
Contributor

Choose a reason for hiding this comment

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

Why have a windows version of this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to move some IPMASQ functions out of main - see updated file.

@rakelkar
Copy link
Contributor Author

rakelkar commented Oct 14, 2017 via email

* Fix build errors after rebase by moving Linux specific for IPMASQ from
main.go to ipmasq.go

* delete unused cniConf struct and redundant comment

* Support for vxlan (overlay) backend in Windows.

* Makes windows VXLAN MAC prefix configurable
Records subnet add/remove time
Recycles remote endpoints if PA address has changed
Sets remote MAC and PA on remote endpoint
Adds config checks to reduce user error
Adds unit tests
@rakelkar rakelkar changed the title Enable Flannel to support Windows for host-gw Enable Flannel to support Windows for host-gw and VXLAN Oct 14, 2017
@rakelkar
Copy link
Contributor Author

Snuff out logrus (it snuck in)

@tomdee
Copy link
Contributor

tomdee commented Oct 20, 2017

@rakelkar If it's possible to submit smaller PRs then that's helpful for me. e.g. moving the ipmasq code out of main might be a generally applicable change which doesn't depend on the Windows changes.

@rakelkar
Copy link
Contributor Author

rakelkar commented Oct 20, 2017 via email

@rakelkar
Copy link
Contributor Author

@tomdee We are planning to break this PR up into the following new PRs:
PR1: ipmasq to build for windows - this is a just refactor, hopefully can be approved without too much controversy :)
PR2: build for windows, appveyor, windows iface code+gonetsh via glide
This PR will focus on getting Flannel to build on windows, with a little bit of functionality to determine the default interface.
PR3a: hostgw
This PR will add _windows files for hostgw functionality
PR3b: vxlan
This PR will add _windows files for vxlan functionality

@rakelkar
Copy link
Contributor Author

Maintenance: The team that own the Windows Host Networking Services has agreed to own maintenance of these features. This is ofcourse dependent on automated testing, still poking about to figure out best to automate.

@michmike
Copy link

cc: @alinbalutoiu

@tomdee
Copy link
Contributor

tomdee commented Nov 24, 2017

Closing this PR as it's now being done in stages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants