You can set the ratio of preemptible instances to pay-as-you-go instances in a node pool. This allows you to reduce costs by controlling the number of preemptible instances when the node pool contains sufficient pay-as-you-go instances. This topic describes how to set the ratio of preemptible instances to pay-as-you-go instances in a node pool for a Container Service for Kubernetes (ACK) cluster.

Prerequisites

A Container Service for Kubernetes (ACK) cluster is created and the Kubernetes version is later than 1.9. For more information, see Create a managed Kubernetes cluster.
Notice
  • Make sure that you have a sufficient node quota in the cluster. To increase the quota, Submit a ticket. For more information about the quota limits related to ACK clusters, see Limits.
  • When you add an existing Elastic Compute Service (ECS) instance to a node pool, make sure that the ECS instance is associated with an elastic IP address (EIP) or a NAT gateway is configured for the virtual private cloud (VPC) where the ECS instance is deployed. You must also make sure that the ECS instance has Internet access. Otherwise, you cannot add the ECS instance.

Procedure

  1. Log on to the ACK console.
  2. In the left-side navigation pane of the ACK console, click Clusters.
  3. On the Clusters page, find the cluster that you want to manage and click the name of the cluster or click Details in the Actions column. The details page of the cluster appears.
  4. In the left-side navigation pane of the details page, choose Nodes > Node Pools.
  5. Select an existing node pool or create a node pool.
    • Find the node pool that you want to modify and click Edit in the Actions column.
    • On the Node Pools page, click Create Node Pool in the upper-right corner. For more information, see Manage node pools.
  6. In the Create Node Pool or Edit Node Pool dialog box, select multiple vSwitches for vSwitch and select Preemptible Instance for Billing Method.
  7. Click Show Advanced Options. Select Cost Optimization for Multi-zone Scaling Policy and set the Percentage of Pay-as-you-go Instances and Enable Supplemental Pay-as-you-go Instances parameters based on your business requirements.
    The following table describes the parameters.
    Parameter Description Default
    Multi-zone Scaling Policy
    • Priority: Nodes are created based on the order of instance types that you select.
    • Cost Optimization: Nodes are created based on the cost of instance types in ascending order.
    • Distribution Balancing: Nodes are created based on the node distribution across zones. This policy aims to evenly distribute nodes across multiple zones.
    Distribution Balancing
    Percentage of Pay-as-you-go Instances The percentage of pay-as-you-go instances that are created in the node pool. The pay-as-you-go instances that are deployed to achieve the guaranteed minimum number of instances in the node pool is not included. 20
    Enable Supplemental Pay-as-you-go Instances Specify whether to automatically create pay-as-you-go instances to reach the expected number when preemptible instances are insufficient. For example, preemptible instances are out of stock or your bidding price is lower than the market price. Turned on
    Note

    After you click Confirm Order:

    • The value of Multi-zone Scaling Policy cannot be changed.
    • If you select Cost Optimization for Multi-zone Scaling Policy, you can change the values of Percentage of Pay-as-you-go Instances and Enable Supplemental Pay-as-you-go Instances.
  8. Click Confirm Order.

What to do next

After you complete the configuration, you can find the node pool on the Node Pools page. Click Details in the Actions column to view Percentage of Pay-as-you-go Instances in the Node Configurations section.