-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Conversation
1f6a757
to
9eb1ff4
Compare
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
9eb1ff4
to
4e73b4c
Compare
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 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" |
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 will need to be added to the glide.* files
import ( | ||
"fmt" | ||
|
||
"github.com/Microsoft/hcsshim" |
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 will also need to be added to glide
@@ -0,0 +1,25 @@ | |||
// +build 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.
Do you need this file since vxlan isn't currently supported on 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.
Merged VXLAN support
@@ -0,0 +1,34 @@ | |||
// +build 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.
Why have a windows version of this file?
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.
Had to move some IPMASQ functions out of main - see updated file.
Thanks for taking a look Tom. Your comments are very reasonable. I'm going
to update the PR with changes I've made for VXLAN and address the easy
fixes like removing logrus and adding some unit tests. Will get back to you
on how best to build/integration test after I get a chance to huddle with
others on the Windows networking team. Just letting you know so you're not
surprised to see the PR increase in feature scope before your comments are
addressed - this will allow me to avoid merge madness.
…On Fri, Oct 13, 2017 at 4:28 PM, Tom Denham ***@***.***> wrote:
***@***.**** requested changes on this pull request.
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
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.
------------------------------
In backend/hostgw/hostgw_network_windows.go
<#832 (comment)>:
> +// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package hostgw
+
+import (
+ "sync"
+ "time"
+
+ log "github.com/golang/glog"
+ "golang.org/x/net/context"
+
+ "github.com/coreos/flannel/backend"
+ "github.com/coreos/flannel/subnet"
+
+ netroute "github.com/rakelkar/gonetsh/netroute"
This will need to be added to the glide.* files
------------------------------
In backend/hostgw/hostgw_windows.go
<#832 (comment)>:
> +// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package hostgw
+
+import (
+ "fmt"
+
+ "github.com/Microsoft/hcsshim"
this will also need to be added to glide
------------------------------
In backend/vxlan/vxlan_windows.go
<#832 (comment)>:
> @@ -0,0 +1,25 @@
+// +build windows
Do you need this file since vxlan isn't currently supported on Windows?
------------------------------
In network/ipmasq_windows.go
<#832 (comment)>:
> @@ -0,0 +1,34 @@
+// +build windows
Why have a windows version of this file?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#832 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADQphVIlA5QEGEzKQh_Nbv4QL5NTfcA2ks5sr_IhgaJpZM4PtGcf>
.
--
Rakesh Kelkar
|
* 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
Snuff out logrus (it snuck in) |
@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. |
Can do..
…On Oct 20, 2017 9:14 AM, "Tom Denham" ***@***.***> wrote:
@rakelkar <https://github.com/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.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#832 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADQpheSFml_G2st5OIjYHffbkBQptlZBks5suMSTgaJpZM4PtGcf>
.
|
@tomdee We are planning to break this PR up into the following new PRs: |
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. |
cc: @alinbalutoiu |
Closing this PR as it's now being done in stages. |
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