This topic describes the capabilities and policies of spot instance node pools in Volcengine Kubernetes Engine (VKE).
Brief introduction
Spot instances are a type of instance offered by Volcano Engine Cloud Service (ECS) under a postpaid model. The Elastic Compute Service instances purchased under this model are available at a significant discount compared to pay-as-you-go, with performance equivalent to standard ECS instances. However, when inventory is insufficient, the system will automatically release the resources of these instances. We recommend that you back up your data in advance. For details, see Spot instances. VKE allows you to select spot instances as the billing model in both normal node pools and managed node pools.
Create spot instance node pools
Configure node pools for spot instances
Spot instance compensation
Spot instance compensation supplements resources before spot instances expire and are reclaimed:
- Enable: The system proactively creates new instances for replacement about 5 minutes before spot instances are reclaimed. As a result, the number of nodes in the node pool may temporarily exceed the expected number. Additionally, when spot nodes are about to be reclaimed in 5 minutes, the system will cordon and drain the old nodes, and then take them offline and remove them. By doing that, the interruption caused by instance reclaim can be avoided.
Description
Updating this configuration for an existing spot instance node pool does not affect the lifecycle of existing nodes in the node pool. The update only affects subsequent instance supplementation policies.
- Disable: will create new spot instances when spot instances are reclaimed upon expiration.
This capability is particularly useful for node pools that use subnets across multiple availability zones. Reclamation of a spot instance usually indicates insufficient inventory of the relevant instance type in the availability zone where the instance resides. In that case, a node pool working on a subnet that spans multiple availability zones and has this feature enabled can obtain replacements from other availability zones before spot instances are reclaimed.
Supplement spot capacity with pay-as-you-go instances
This feature is to use pay-as-you-go ECS instances as replacements when spot instances are not available.
- Enable: When spot instances are unavailable due to insufficient inventory or other reasons, pay-as-you-go instances are used as supplements in scenarios such as manual scale-out, Cluster Autoscaler, and compensation for spot instance reclamation. Supplemental pay-as-you-go instances are not replaced even if spot instances become available again. These pay-as-you-go instances are released first only during node scale-in.
tip
- If you enable this feature, ensure the selected node specification supports both the Pay-as-you-go and Spot instance billing models.
- If both the Node distribution ratio policy and Supplement preemptive capacity by pay-as-you-go instances are enabled in the current node pool, the percentage of pay-as-you-go instances in the node pool may exceed the configured value.
- Updating this configuration for an existing spot instance node pool does not affect the lifecycle of existing nodes in the node pool. The update only affects subsequent instance supplementation policies.
- Disable: will not use pay-as-you-go instances as replacements. Other policies you have set will apply.
Node distribution ratio policy
If enabled, you can configure the percentage of pay-as-you-go and spot instances for the node pool. The configurable parameters are as follows:
After you enable Node distribution ratio policy and finish the configuration of the related parameters, the system will calculate based on the number of pay-as-you-go instances and the non-expired spot instances in the node pool, and then apply the following policies to perform resource compensation when the spot instances are about to be reclaimed:
- Create supplementary pay-as-you-go instances if the current number of pay-as-you-go instances does not meet the requirement of Baseline capacity of pay-as-you-go instances.
- If the Baseline capacity of pay-as-you-go instances is met, the system then checks whether the ratio of pay-as-you-go instances is met. If the ratio is not met, pay-as-you-go instances are created as supplements. If the ratio is met, spot instances are created as supplements.
tip
Updating this configuration for an existing spot instance node pool does not affect the lifecycle of existing nodes in the node pool. The update only affects subsequent instance supplementation policies.