1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-08 18:39:40 +00:00

Extend rke to tolerate the Windows host

1. Support to configure Flannel as "host-gw" backend
2. Define the network component yaml and ingress
   controller yaml only schedule to non-Windows node
3. Support to configure Docker container's port publishing
This commit is contained in:
MaiWJ
2018-05-30 16:30:12 +08:00
committed by Craig Jellick
parent dffc2b9443
commit bcb6e13618
8 changed files with 81 additions and 15 deletions

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"github.com/docker/docker/api/types/container"
"github.com/docker/go-connections/nat"
"github.com/rancher/rke/docker"
"github.com/rancher/rke/hosts"
"github.com/rancher/rke/log"
@@ -88,12 +89,14 @@ func GetProcessConfig(process v3.Process) (*container.Config, *container.HostCon
}
// var pidMode container.PidMode
// pidMode = process.PidMode
_, portBindings, _ := nat.ParsePortSpecs(process.Publish)
hostCfg := &container.HostConfig{
VolumesFrom: process.VolumesFrom,
Binds: process.Binds,
NetworkMode: container.NetworkMode(process.NetworkMode),
PidMode: container.PidMode(process.PidMode),
Privileged: process.Privileged,
VolumesFrom: process.VolumesFrom,
Binds: process.Binds,
NetworkMode: container.NetworkMode(process.NetworkMode),
PidMode: container.PidMode(process.PidMode),
Privileged: process.Privileged,
PortBindings: portBindings,
}
if len(process.RestartPolicy) > 0 {
hostCfg.RestartPolicy = container.RestartPolicy{Name: process.RestartPolicy}