createCluster: take loadbalancer into consideration when mapping ports

pull/249/head
iwilltry42 4 years ago
parent c531a7b4bb
commit 0270ac7327
No known key found for this signature in database
GPG Key ID: 7BA57AD1CFF16110
  1. 8
      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 {

Loading…
Cancel
Save