diff --git a/README.md b/README.md index 3fde698241..c3de9a4950 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,12 @@ apply to CloudFormation stacks but not EKS clusters. eksctl create cluster --tags environment=staging --region=us-east-1 ``` +To configure node volume size, use the `--node-volume-size` flag. + +``` +eksctl create cluster --node-volume-size=50 +``` + > NOTE: In `us-east-1` you are likely to get `UnsupportedAvailabilityZoneException`. If you do, copy the suggested zones and pass `--zones` flag, e.g. `eksctl create cluster --region=us-east-1 --zones=us-east-1a,us-east-1b,us-east-1d`. This may occur in other regions, but less likely. You shouldn't need to use `--zone` flag otherwise. To delete a cluster, run: diff --git a/cmd/eksctl/create.go b/cmd/eksctl/create.go index 2b554bda39..62aee48991 100644 --- a/cmd/eksctl/create.go +++ b/cmd/eksctl/create.go @@ -75,6 +75,7 @@ func createClusterCmd() *cobra.Command { fs.IntVarP(&cfg.MinNodes, "nodes-min", "m", 0, "minimum nodes in ASG") fs.IntVarP(&cfg.MaxNodes, "nodes-max", "M", 0, "maximum nodes in ASG") + fs.IntVarP(&cfg.NodeVolumeSize, "node-volume-size", "", 0, "Node volume size (in GB)") fs.IntVar(&cfg.MaxPodsPerNode, "max-pods-per-node", 0, "maximum number of pods per node (set automatically if unspecified)") fs.StringSliceVar(&availabilityZones, "zones", nil, "(auto-select if unspecified)") diff --git a/pkg/cfn/builder/nodegroup.go b/pkg/cfn/builder/nodegroup.go index e2fa5b6965..365283d9f6 100644 --- a/pkg/cfn/builder/nodegroup.go +++ b/pkg/cfn/builder/nodegroup.go @@ -89,6 +89,16 @@ func (n *nodeGroupResourceSet) addResourcesForNodeGroup() { if n.spec.NodeSSH { lc.KeyName = gfn.NewString(n.spec.SSHPublicKeyName) } + if n.spec.NodeVolumeSize > 0 { + lc.BlockDeviceMappings = []gfn.AWSAutoScalingLaunchConfiguration_BlockDeviceMapping{ + { + DeviceName: gfn.NewString("/dev/xvda"), + Ebs: &gfn.AWSAutoScalingLaunchConfiguration_BlockDevice{ + VolumeSize: gfn.NewInteger(n.spec.NodeVolumeSize), + }, + }, + } + } refLC := n.newResource("NodeLaunchConfig", lc) // currently goformation type system doesn't allow specifying `VPCZoneIdentifier: { "Fn::ImportValue": ... }`, // and tags don't have `PropagateAtLaunch` field, so we have a custom method here until this gets resolved diff --git a/pkg/eks/api/api.go b/pkg/eks/api/api.go index 5871825306..e3ea0b1758 100644 --- a/pkg/eks/api/api.go +++ b/pkg/eks/api/api.go @@ -40,6 +40,8 @@ type ClusterConfig struct { MinNodes int MaxNodes int + NodeVolumeSize int + MaxPodsPerNode int NodePolicyARNs []string