You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(eks): spot support for managed nodegroups (#11962)
This PR adds the `CapacityType` support and allows users to create Spot managed node groups for Amazon EKS.
1. The `CapacityType` attribute is supported by cloudformation but not yet documented. We tentatively use addPropertyOverride() to enable it.
2. `instanceType` will be deprecated and we introduced the new `instanceTypes`
3. `instanceTypes` with different CPU architectures will throw an error.
4. `amiType` is still optional, however, when specified, incorrect `amiType` will throw the error.
5. According to the [document](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-instancetypes), we are allowed to specify instance type(s) in either `instanceTypes` property or launch template but not both. As we can't check the content of the launch template passed in, we allow `instanceTypes` and launch template both specified and encourage to use `instanceTypes` when possible.
## Sample
```ts
cluster.addNodegroupCapacity('extra-ng-spot', {
instanceTypes: [
new ec2.InstanceType('c5.large'),
new ec2.InstanceType('c5a.large'),
new ec2.InstanceType('c5d.large'),
],
minSize: 3,
capacityType: eks.CapacityType.SPOT,
});
```
Closes#11827
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Use `capacityType` to create managed node groups comprised of spot instances. To maximize the availability of your applications while using
215
+
Spot Instances, we recommend that you configure a Spot managed node group to use multiple instance types with the `instanceTypes` property.
216
+
217
+
> For more details visit [Managed node group capacity types](https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html#managed-node-group-capacity-types).
218
+
219
+
220
+
```ts
221
+
cluster.addNodegroupCapacity('extra-ng-spot', {
222
+
instanceTypes: [
223
+
newec2.InstanceType('c5.large'),
224
+
newec2.InstanceType('c5a.large'),
225
+
newec2.InstanceType('c5d.large'),
226
+
],
227
+
minSize: 3,
228
+
capacityType: eks.CapacityType.SPOT,
229
+
});
230
+
231
+
```
232
+
212
233
#### Launch Template Support
213
234
214
235
You can specify a launch template that the node group will use. Note that when using a custom AMI, Amazon EKS doesn't merge any user data.
0 commit comments