-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Spot Virtual Machines | ||
|
||
[Azure Spot Virtual Machines](https://azure.microsoft.com/en-gb/pricing/spot/) allow users to reduce the costs of their | ||
compute resources by utilising Azure's spare capacity for a lower price. | ||
|
||
With this lower cost, comes the risk of preemption. | ||
When capacity within a particular Availability Zone is increased, | ||
Azure may need to reclaim Spot Virtual Machines to satisfy the demand on their data centres. | ||
|
||
## When should I use Spot Virtual Machines? | ||
|
||
Spot Virtual Machines 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 do I use Spot Virtual Machines? | ||
|
||
**Note**: This feature is only available on Machines at present and not on the | ||
experimental MachinePools. | ||
|
||
To enable a Machine to be backed by a Spot Virtual Machine, add `spotMarketOptions` | ||
to your `AzureMachineTemplate`: | ||
|
||
```yaml | ||
apiVersion: exp.infrastructure.cluster.x-k8s.io/v1alpha3 | ||
kind: AzureMachineTemplate | ||
metadata: | ||
name: capz-mp-0 | ||
spec: | ||
location: westus2 | ||
template: | ||
osDisk: | ||
diskSizeGB: 30 | ||
managedDisk: | ||
storageAccountType: Premium_LRS | ||
osType: Linux | ||
sshPublicKey: ${YOUR_SSH_PUB_KEY} | ||
vmSize: Standard_D2s_v3 | ||
spotMarketOptions: {} | ||
``` | ||
You may also add a `maxPrice` to the options to limit the maximum spend for the | ||
instance. It is however, recommend **not** to set a `maxPrice` as Azure will | ||
cap your spending at the on-demand price if this field is left empty and you will | ||
experience fewer interruptions. | ||
|
||
```yaml | ||
spec: | ||
template: | ||
spotMarketOptions: | ||
maxPrice: "0.04" Price in USD per hour (up to 5 decimal places) | ||
``` |