Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure node volume size #229

Merged
merged 4 commits into from
Oct 5, 2018
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions cmd/eksctl/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)")

Expand Down
10 changes: 10 additions & 0 deletions pkg/cfn/builder/nodegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions pkg/eks/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ type ClusterConfig struct {
MinNodes int
MaxNodes int

NodeVolumeSize int

This comment was marked as abuse.


MaxPodsPerNode int

NodePolicyARNs []string
Expand Down