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

Add EKS AWSManagedMachinePool example to spot instances doc #3523

Merged
merged 1 commit into from
Jun 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 17 additions & 2 deletions docs/book/src/topics/spot-instances.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Although, with this lower cost, comes the risk of preemption. When capacity with

Spot instances are ideal for workloads that can be interrupted. For example, short jobs or stateless services that can be rescheduled quickly, without data loss, and resume operation with limited degradation to a service.

## How to use spot instances?
## Using Spot Instances with AWSMachine

To enable AWS Machine to be backed by a Spot Instance, users need to add `spotMarketOptions` to AWSMachineTemplate:
```yaml
Expand All @@ -34,4 +34,19 @@ spec:
spotMarketOptions:
maxPrice: 0.02 # Price in USD per hour (up to 5 decimal places)
```
> **IMPORTANT NOTE**: The experimental feature `MachinePool` does not support using spot instances as of now.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct, good to have a note or warning on this here if there is no other warning in the doc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor Author

@pydctw pydctw Jun 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good point. Slightly modified the note from MachinePool to AWSMachinePool as one variation of machine pool implementation, AWSManagedMachinePool, supports spot instance and moved to the end.


## Using Spot Instances with AWSManagedMachinePool
To use spot instance in EKS managed node groups for a EKS cluster, set `capacityType` to `spot` in `AWSManagedMachinePool`.
```yaml
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AWSManagedMachinePool
metadata:
name: ${CLUSTER_NAME}-pool-0
spec:
capacityType: spot
...
```

See [AWS doc](https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html) for more details.

> **IMPORTANT NOTE**: The experimental feature `AWSMachinePool` does not support using spot instances as of now.