diff --git a/cmd/kops/create_cluster.go b/cmd/kops/create_cluster.go index 749e5355e7..6c470ccbea 100644 --- a/cmd/kops/create_cluster.go +++ b/cmd/kops/create_cluster.go @@ -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 } diff --git a/docs/cli/kops_create_cluster.md b/docs/cli/kops_create_cluster.md index 2fb47182a8..2f6f5c2682 100644 --- a/docs/cli/kops_create_cluster.md +++ b/docs/cli/kops_create_cluster.md @@ -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")