mirror of https://github.com/kubernetes/kops.git
Add --bastion-image flag to "kops create cluster"
This commit is contained in:
parent
1591aaf40f
commit
1380f1d2dd
|
|
@ -267,6 +267,8 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
|
||||||
cmd.RegisterFlagCompletionFunc("node-image", completeInstanceImage)
|
cmd.RegisterFlagCompletionFunc("node-image", completeInstanceImage)
|
||||||
cmd.Flags().StringVar(&options.MasterImage, "master-image", options.MasterImage, "Machine image for masters. Takes precedence over --image")
|
cmd.Flags().StringVar(&options.MasterImage, "master-image", options.MasterImage, "Machine image for masters. Takes precedence over --image")
|
||||||
cmd.RegisterFlagCompletionFunc("master-image", completeInstanceImage)
|
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.Flags().StringVar(&options.NodeSize, "node-size", options.NodeSize, "Machine type for worker nodes")
|
||||||
cmd.RegisterFlagCompletionFunc("node-size", completeMachineType)
|
cmd.RegisterFlagCompletionFunc("node-size", completeMachineType)
|
||||||
|
|
|
||||||
|
|
@ -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'.
|
--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")
|
--authorization string Authorization mode: AlwaysAllow or RBAC (default "RBAC")
|
||||||
--bastion Enable a bastion instance group. Only applies to private topology.
|
--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")
|
--channel string Channel for default versions and configuration to use (default "stable")
|
||||||
--cloud string Cloud provider to use - aws, digitalocean, gce, hetzner, openstack
|
--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").
|
--cloud-labels string A list of key/value pairs used to tag all instance groups (for example "Owner=John Doe,Team=Some Team").
|
||||||
|
|
|
||||||
|
|
@ -153,11 +153,12 @@ type NewClusterOptions struct {
|
||||||
// InstanceManager specifies which manager to use for managing instances.
|
// InstanceManager specifies which manager to use for managing instances.
|
||||||
InstanceManager string
|
InstanceManager string
|
||||||
|
|
||||||
Image string
|
Image string
|
||||||
NodeImage string
|
NodeImage string
|
||||||
MasterImage string
|
MasterImage string
|
||||||
MasterSize string
|
BastionImage string
|
||||||
NodeSize string
|
MasterSize string
|
||||||
|
NodeSize string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *NewClusterOptions) InitDefaults() {
|
func (o *NewClusterOptions) InitDefaults() {
|
||||||
|
|
@ -1125,7 +1126,6 @@ func setupTopology(opt *NewClusterOptions, cluster *api.Cluster, allZones sets.S
|
||||||
cluster.Spec.Topology = &api.TopologySpec{
|
cluster.Spec.Topology = &api.TopologySpec{
|
||||||
ControlPlane: api.TopologyPublic,
|
ControlPlane: api.TopologyPublic,
|
||||||
Nodes: api.TopologyPublic,
|
Nodes: api.TopologyPublic,
|
||||||
// Bastion: &api.BastionSpec{Enable: c.Bastion},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if opt.Bastion {
|
if opt.Bastion {
|
||||||
|
|
@ -1248,6 +1248,7 @@ func setupTopology(opt *NewClusterOptions, cluster *api.Cluster, allZones sets.S
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bastionGroup.Spec.Image = opt.BastionImage
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue