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 2a429aac65
commit 47abaf362e

@ -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)
}

@ -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