Skip to content

Commit

Permalink
Merge pull request #229 from jmcarp/issue-214-volume-size
Browse files Browse the repository at this point in the history
Configure node volume size and encryption.
  • Loading branch information
errordeveloper authored Oct 5, 2018
2 parents 60ddc59 + 2bb451d commit fef499e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
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

MaxPodsPerNode int

NodePolicyARNs []string
Expand Down

0 comments on commit fef499e

Please sign in to comment.