mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-06 09:22:42 +08:00
added kubernetes listen port
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
"github.com/gravitl/netmaker/servercfg"
|
||||||
"github.com/gravitl/netmaker/models"
|
"github.com/gravitl/netmaker/models"
|
||||||
"github.com/gravitl/netmaker/netclient/ncutils"
|
"github.com/gravitl/netmaker/netclient/ncutils"
|
||||||
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
||||||
@@ -16,6 +16,9 @@ import (
|
|||||||
|
|
||||||
// == Join, Checkin, and Leave for Server ==
|
// == 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
|
// ServerJoin - responsible for joining a server to a network
|
||||||
func ServerJoin(network string, serverID string, privateKey string) error {
|
func ServerJoin(network string, serverID string, privateKey string) error {
|
||||||
|
|
||||||
@@ -33,6 +36,9 @@ func ServerJoin(network string, serverID string, privateKey string) error {
|
|||||||
MacAddress: serverID,
|
MacAddress: serverID,
|
||||||
UDPHolePunch: "no",
|
UDPHolePunch: "no",
|
||||||
}
|
}
|
||||||
|
if servercfg.GetPlatform() == "Kubernetes" {
|
||||||
|
node.ListenPort = KUBERNETES_LISTEN_PORT
|
||||||
|
}
|
||||||
node.SetDefaults()
|
node.SetDefaults()
|
||||||
|
|
||||||
if node.LocalRange != "" && node.LocalAddress == "" {
|
if node.LocalRange != "" && node.LocalAddress == "" {
|
||||||
|
Reference in New Issue
Block a user