Add --bastion-image flag to "kops create cluster"

This commit is contained in:
John Gardiner Myers 2022-11-12 11:59:10 -08:00
parent 1591aaf40f
commit 1380f1d2dd
3 changed files with 10 additions and 6 deletions

View File

@ -267,6 +267,8 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
cmd.RegisterFlagCompletionFunc("node-image", completeInstanceImage)
cmd.Flags().StringVar(&options.MasterImage, "master-image", options.MasterImage, "Machine image for masters. Takes precedence over --image")
cmd.RegisterFlagCompletionFunc("master-image", completeInstanceImage)
cmd.Flags().StringVar(&options.BastionImage, "bastion-image", options.BastionImage, "Machine image for bastions. Takes precedence over --image")
cmd.RegisterFlagCompletionFunc("bastion-image", completeInstanceImage)
cmd.Flags().StringVar(&options.NodeSize, "node-size", options.NodeSize, "Machine type for worker nodes")
cmd.RegisterFlagCompletionFunc("node-size", completeMachineType)

View File

@ -71,6 +71,7 @@ kops create cluster [CLUSTER] [flags]
--associate-public-ip Specify --associate-public-ip=[true|false] to enable/disable association of public IP for master ASG and nodes. Default is 'true'.
--authorization string Authorization mode: AlwaysAllow or RBAC (default "RBAC")
--bastion Enable a bastion instance group. Only applies to private topology.
--bastion-image string Machine image for bastions. Takes precedence over --image
--channel string Channel for default versions and configuration to use (default "stable")
--cloud string Cloud provider to use - aws, digitalocean, gce, hetzner, openstack
--cloud-labels string A list of key/value pairs used to tag all instance groups (for example "Owner=John Doe,Team=Some Team").

View File

@ -156,6 +156,7 @@ type NewClusterOptions struct {
Image string
NodeImage string
MasterImage string
BastionImage string
MasterSize string
NodeSize string
}
@ -1125,7 +1126,6 @@ func setupTopology(opt *NewClusterOptions, cluster *api.Cluster, allZones sets.S
cluster.Spec.Topology = &api.TopologySpec{
ControlPlane: api.TopologyPublic,
Nodes: api.TopologyPublic,
// Bastion: &api.BastionSpec{Enable: c.Bastion},
}
if opt.Bastion {
@ -1248,6 +1248,7 @@ func setupTopology(opt *NewClusterOptions, cluster *api.Cluster, allZones sets.S
}
}
bastionGroup.Spec.Image = opt.BastionImage
}
default: