From a39ef1639406c465b9ee3efdf9eb47d62ee498fd Mon Sep 17 00:00:00 2001 From: afeiszli Date: Fri, 15 Oct 2021 14:15:32 -0400 Subject: [PATCH] added kubernetes listen port --- logic/server.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/logic/server.go b/logic/server.go index 5de343e3..7427ab38 100644 --- a/logic/server.go +++ b/logic/server.go @@ -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 == "" {