Browse Source

Added new flannel backend to use wireguard from flannel

Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
pull/5391/head
Roberto Bonafiglia 3 years ago
parent
commit
47abaf362e
  1. 7
      pkg/agent/flannel/setup.go
  2. 13
      pkg/daemons/config/types.go

7
pkg/agent/flannel/setup.go

@ -75,6 +75,11 @@ const (
"SubnetRemoveCommand": "read PUBLICKEY; wg set flannel.1 peer $PUBLICKEY remove"
}`
wireguardNativeBackend = `{
"Type": "wireguard",
"PersistentKeepaliveInterval": 25
}`
emptyIPv6Network = "::/0"
ipv4 = iota
@ -199,6 +204,8 @@ func createFlannelConf(nodeConfig *config.Node) error {
}
case config.FlannelBackendWireguard:
backendConf = strings.ReplaceAll(wireguardBackend, "%flannelConfDir%", filepath.Dir(nodeConfig.FlannelConfFile))
case config.FlannelBackendNativeWireguard:
backendConf = wireguardNativeBackend
default:
return fmt.Errorf("Cannot configure unknown flannel backend '%s'", nodeConfig.FlannelBackend)
}

13
pkg/daemons/config/types.go

@ -17,12 +17,13 @@ import (
)
const (
FlannelBackendNone = "none"
FlannelBackendVXLAN = "vxlan"
FlannelBackendHostGW = "host-gw"
FlannelBackendIPSEC = "ipsec"
FlannelBackendWireguard = "wireguard"
CertificateRenewDays = 90
FlannelBackendNone = "none"
FlannelBackendVXLAN = "vxlan"
FlannelBackendHostGW = "host-gw"
FlannelBackendIPSEC = "ipsec"
FlannelBackendWireguard = "wireguard"
FlannelBackendNativeWireguard = "native-wireguard"
CertificateRenewDays = 90
)
type Node struct {

Loading…
Cancel
Save