Create zero-node IGs if more zones than nodes

This commit is contained in:
John Gardiner Myers 2020-07-17 10:22:16 -07:00
parent d0b30cf771
commit e9b8e4e39a
3 changed files with 2 additions and 4 deletions

View File

@ -215,7 +215,7 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
cmd.Flags().StringVar(&sshPublicKey, "ssh-public-key", sshPublicKey, "SSH public key to use (defaults to ~/.ssh/id_rsa.pub on AWS)")
cmd.Flags().Int32Var(&options.MasterCount, "master-count", options.MasterCount, "Set number of masters. Defaults to one master per master-zone")
cmd.Flags().Int32Var(&options.NodeCount, "node-count", options.NodeCount, "Set number of nodes. Defaults to one node per zone")
cmd.Flags().Int32Var(&options.NodeCount, "node-count", options.NodeCount, "Set total number of nodes. Defaults to one node per zone")
cmd.Flags().StringVar(&options.Image, "image", options.Image, "Set image for all instances.")
cmd.Flags().StringVar(&options.NodeImage, "node-image", options.NodeImage, "Set image for nodes. Takes precedence over --image")

View File

@ -95,7 +95,7 @@ kops create cluster [flags]
--master-zones strings Zones in which to run masters (must be an odd number)
--network-cidr string Set to override the default network CIDR
--networking string Networking mode to use. kubenet, external, weave, flannel-vxlan (or flannel), flannel-udp, calico, canal, kube-router, amazonvpc, cilium, cilium-etcd, cni, lyftvpc. (default "kubenet")
--node-count int32 Set number of nodes. Defaults to one node per zone
--node-count int32 Set total number of nodes. Defaults to one node per zone
--node-image string Set image for nodes. Takes precedence over --image
--node-security-groups strings Add precreated additional security groups to nodes.
--node-size string Set instance size for nodes

View File

@ -715,8 +715,6 @@ func setupNodes(opt *NewClusterOptions, cluster *api.Cluster, zoneToSubnetMap ma
count := countPerIG
if i < remainder {
count++
} else if count == 0 {
break
}
g := &api.InstanceGroup{}