From 6736e2467313ac199876669e85b410543f0fb270 Mon Sep 17 00:00:00 2001 From: Segator Date: Tue, 26 Nov 2019 20:27:06 +0100 Subject: [PATCH] support hostgw --- pkg/agent/flannel/setup.go | 7 ++++++- pkg/daemons/config/types.go | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/agent/flannel/setup.go b/pkg/agent/flannel/setup.go index dbf5ce8ac0..caf629799f 100644 --- a/pkg/agent/flannel/setup.go +++ b/pkg/agent/flannel/setup.go @@ -44,6 +44,9 @@ const ( "Backend": %backend% } ` + hostGwBackend = `{ + "Type": "host-gw" +}` vxlanBackend = `{ "Type": "vxlan" @@ -127,6 +130,8 @@ func createFlannelConf(nodeConfig *config.Node) error { } case config.FlannelBackendWireguard: backendConf = wireguardBackend + case config.FlannelBackendHOSTGW: + backendConf = hostGwBackend default: return fmt.Errorf("Cannot configure unknown flannel backend '%s'", nodeConfig.FlannelBackend) } @@ -161,4 +166,4 @@ func setupStrongSwan(nodeConfig *config.Node) error { // make new strongswan link return os.Symlink(dataDir, nodeConfig.AgentConfig.StrongSwanDir) -} +} \ No newline at end of file diff --git a/pkg/daemons/config/types.go b/pkg/daemons/config/types.go index d1f23fc9d1..ef99343b3f 100644 --- a/pkg/daemons/config/types.go +++ b/pkg/daemons/config/types.go @@ -18,6 +18,7 @@ const ( FlannelBackendVXLAN = "vxlan" FlannelBackendIPSEC = "ipsec" FlannelBackendWireguard = "wireguard" + FlannelBackendHOSTGW = "hostgw" ) type Node struct {