From 0270ac73278e2baed7aceccaf8f462e9c6002c6b Mon Sep 17 00:00:00 2001 From: iwilltry42 Date: Tue, 26 May 2020 17:20:38 +0200 Subject: [PATCH] createCluster: take loadbalancer into consideration when mapping ports --- cmd/create/createCluster.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/create/createCluster.go b/cmd/create/createCluster.go index 0b5df7db..cf308c79 100644 --- a/cmd/create/createCluster.go +++ b/cmd/create/createCluster.go @@ -374,9 +374,13 @@ func parseCreateClusterCmd(cmd *cobra.Command, args []string, createClusterOpts } // append ports + lbCount := 1 + if createClusterOpts.DisableLoadBalancer { + lbCount = 0 + } for portmap, filters := range portFilterMap { - if len(filters) == 0 && (masterCount+workerCount) > 1 { - log.Fatalf("Malformed portmapping '%s' lacks a node filter, but there is more than one node.", portmap) + if len(filters) == 0 && (masterCount+workerCount+lbCount) > 1 { + log.Fatalf("Malformed portmapping '%s' lacks a node filter, but there is more than one node (including the loadbalancer, if there is any).", portmap) } nodes, err := cliutil.FilterNodes(append(cluster.Nodes, cluster.MasterLoadBalancer), filters) if err != nil {