Initial commit to add option to set volume size at creation

This commit is contained in:
Matt Marchetti 2017-06-09 10:53:25 -04:00
parent 9400be0834
commit c847bd1fa3
2 changed files with 19 additions and 0 deletions

View File

@ -59,6 +59,8 @@ type CreateClusterOptions struct {
MasterSize string
MasterCount int32
NodeCount int32
MasterVolumeSize int32
NodeVolumeSize int32
EncryptEtcdStorage bool
Project string
KubernetesVersion string
@ -231,6 +233,9 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
cmd.Flags().StringVar(&options.MasterSize, "master-size", options.MasterSize, "Set instance size for masters")
cmd.Flags().Int32Var(&options.MasterVolumeSize, "master-volume-size", options.MasterVolumeSize, "Set instance volume size (in GB) for masters")
cmd.Flags().Int32Var(&options.NodeVolumeSize, "node-volume-size", options.NodeVolumeSize, "Set instance volume size (in GB) for nodes")
cmd.Flags().StringVar(&options.VPCID, "vpc", options.VPCID, "Set to use a shared VPC")
cmd.Flags().StringVar(&options.NetworkCIDR, "network-cidr", options.NetworkCIDR, "Set to override the default network CIDR")
@ -575,6 +580,18 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e
}
}
if c.MasterVolumeSize != 0 {
for _, group := range masters {
group.Spec.RootVolumeSize = fi.Int32(c.MasterVolumeSize)
}
}
if c.NodeVolumeSize != 0 {
for _, group := range nodes {
group.Spec.RootVolumeSize = fi.Int32(c.NodeVolumeSize)
}
}
if c.DNSZone != "" {
cluster.Spec.DNSZone = c.DNSZone
}

View File

@ -75,6 +75,7 @@ kops create cluster
--master-security-groups stringSlice Add precreated additional security groups to masters.
--master-size string Set instance size for masters
--master-tenancy string The tenancy of the master group on AWS. Can either be default or dedicated.
--master-volume-size int32 Set instance volume size (in GB) for masters
--master-zones stringSlice Zones in which to run masters (must be an odd number)
--model string Models to apply (separate multiple models with commas) (default "config,proto,cloudup")
--network-cidr string Set to override the default network CIDR
@ -83,6 +84,7 @@ kops create cluster
--node-security-groups stringSlice Add precreated additional security groups to nodes.
--node-size string Set instance size for nodes
--node-tenancy string The tenancy of the node group on AWS. Can be either default or dedicated.
--node-volume-size int32 Set instance volume size (in GB) for nodes
--out string Path to write any local output
--project string Project to use (must be set on GCE)
--ssh-public-key string SSH public key to use (default "~/.ssh/id_rsa.pub")