added kubernetes listen port

This commit is contained in:
afeiszli 2021-10-15 14:15:32 -04:00
parent d7abd9c612
commit a39ef16394

View file

@ -8,7 +8,7 @@ import (
"strconv"
"strings"
"time"
"github.com/gravitl/netmaker/servercfg"
"github.com/gravitl/netmaker/models"
"github.com/gravitl/netmaker/netclient/ncutils"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
@ -16,6 +16,9 @@ import (
// == Join, Checkin, and Leave for Server ==
// KUBERNETES_LISTEN_PORT - starting port for Kubernetes in order to use NodePort range
const KUBERNETES_LISTEN_PORT = 31821
// ServerJoin - responsible for joining a server to a network
func ServerJoin(network string, serverID string, privateKey string) error {
@ -33,6 +36,9 @@ func ServerJoin(network string, serverID string, privateKey string) error {
MacAddress: serverID,
UDPHolePunch: "no",
}
if servercfg.GetPlatform() == "Kubernetes" {
node.ListenPort = KUBERNETES_LISTEN_PORT
}
node.SetDefaults()
if node.LocalRange != "" && node.LocalAddress == "" {