Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions cmd/kops/create_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ type CreateClusterOptions struct {

ControlPlaneVolumeSize int32
NodeVolumeSize int32
NodeVolumeType string
ContainerRuntime string
OutDir string
DisableSubnetTags bool
Expand Down Expand Up @@ -301,6 +302,8 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
cmd.Flags().Int32Var(&options.ControlPlaneVolumeSize, "control-plane-volume-size", options.ControlPlaneVolumeSize, "Instance volume size (in GB) for control-plane nodes")
cmd.Flags().Int32Var(&options.NodeVolumeSize, "node-volume-size", options.NodeVolumeSize, "Instance volume size (in GB) for worker nodes")

cmd.Flags().StringVar(&options.NodeVolumeType, "node-volume-type", options.NodeVolumeType, "Instance volume type (e.g. gp2, gp3, io1) for worker nodes")

cmd.Flags().StringVar(&options.NetworkID, "vpc", options.NetworkID, "Shared Network or VPC to use")
cmd.Flags().MarkDeprecated("vpc", "use --network-id instead")
cmd.RegisterFlagCompletionFunc("vpc", completeNetworkID)
Expand Down Expand Up @@ -625,6 +628,15 @@ func RunCreateCluster(ctx context.Context, f *util.Factory, out io.Writer, c *Cr
}
}

if c.NodeVolumeType != "" {
for _, group := range nodes {
if group.Spec.RootVolume == nil {
group.Spec.RootVolume = &api.InstanceRootVolumeSpec{}
}
group.Spec.RootVolume.Type = fi.PtrTo(c.NodeVolumeType)
}
}

if c.DNSZone != "" {
cluster.Spec.DNSZone = c.DNSZone
}
Expand Down
1 change: 1 addition & 0 deletions docs/cli/kops_create_cluster.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading