Skip to content

Commit

Permalink
Add ml-bindport / METALLB_ML_BIND_PORT config
Browse files Browse the repository at this point in the history
Docker EE already uses port 7946 (likely memberlist)
Fixes #581

Signed-off-by: Etienne Champetier <echampetier@anevia.com>
  • Loading branch information
champtar committed Apr 14, 2020
1 parent 9d6de1e commit 8fd5c6d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions speaker/main.go
Expand Up @@ -22,6 +22,7 @@ import (
"net"
"os"
"os/signal"
"strconv"
"syscall"
"time"

Expand Down Expand Up @@ -71,6 +72,7 @@ func main() {
config = flag.String("config", "config", "Kubernetes ConfigMap containing MetalLB's configuration")
host = flag.String("host", os.Getenv("METALLB_HOST"), "HTTP host address")
mlBindAddr = flag.String("ml-bindaddr", os.Getenv("METALLB_ML_BIND_ADDR"), "Bind addr for MemberList (fast dead node detection)")
mlBindPort = flag.String("ml-bindport", os.Getenv("METALLB_ML_BIND_PORT"), "Bind port for MemberList (fast dead node detection)")
mlLabels = flag.String("ml-labels", os.Getenv("METALLB_ML_LABELS"), "Labels to match the speakers (for MemberList / fast dead node detection)")
mlNamespace = flag.String("ml-namespace", os.Getenv("METALLB_ML_NAMESPACE"), "Namespace of the speakers (for MemberList / fast dead node detection)")
mlSecret = flag.String("ml-secret-key", os.Getenv("METALLB_ML_SECRET_KEY"), "Secret key for MemberList (fast dead node detection)")
Expand Down Expand Up @@ -106,6 +108,14 @@ func main() {
// mconfig.Name MUST be spec.nodeName, as we will match it against Enpoints nodeName in usableNodes()
mconfig.Name = *myNode
mconfig.BindAddr = *mlBindAddr
if *mlBindPort != "" {
port, err := strconv.Atoi(*mlBindPort)
if err != nil {
logger.Log("op", "startup", "error", "unable to parse ml-bindport", "msg", err)
}
mconfig.BindPort = port
mconfig.AdvertisePort = port
}
mconfig.Logger = golog.New(goKitLogWriter{logger}, "", golog.Lshortfile)
if *mlSecret != "" {
sha := sha256.New()
Expand Down

0 comments on commit 8fd5c6d

Please sign in to comment.