All Products
Search
Document Center

Container Service for Kubernetes:Achieve Container Scaling in Seconds Using ack-autoscaling-placeholder

Last Updated:Mar 07, 2026

If your business requires fast workload startup and you do not need to consider node resource constraints, use the ack-autoscaling-placeholder component. This component provides a buffer for cluster auto-scaling. When node resources are insufficient, actual workloads preempt resources reserved by placeholder workloads to start quickly. You can combine this with node autoscaling to trigger node-level expansion in the cluster. This topic describes how to achieve container scaling in seconds using ack-autoscaling-placeholder.

Operation Flow

image

Prerequisites

  • Enable Auto Scaling for the ACK cluster and configure an elastic node pool. For more information, see Enable Node Autoscaling.

  • Set node labels for the elastic node pool using the Node Labels configuration item. This schedules workloads to specific node pools, which helps verify results. For more information, see Create and Manage Node Pools.

    This topic uses the demo=yes label as an example.

Step 1: Deploy the ack-autoscaling-placeholder component and create a placeholder workload

ack-autoscaling-placeholder provides a buffer for cluster auto-scaling, enabling over-provisioning and pre-warming of cluster nodes. This ensures that workloads can scale out quickly without waiting for new nodes to be created and join the cluster.

  1. Log on to the Container Service Management Console . In the navigation pane on the left, click Marketplace > Marketplace.

  2. On the App Catalog tab, search for ack-autoscaling-placeholder, then click ack-autoscaling-placeholder.

  3. On the ack-autoscaling-placeholder page, click Deploy.

  4. On the creation panel, complete the configuration as prompted, then click OK.

    Replace the content of Parameters on the Parameter tab with the following YAML example.

    View YAML Example

    nameOverride: ""
    fullnameOverride: ""
    ##
    priorityClassDefault:
      enabled: true
      name: default-priority-class   # The default priority is low.
      value: -1
    
    ##
    deployments:
       - name: ack-place-holder
         replicaCount: 1
         containers:
           - name: placeholder
             image: registry-vpc.cn-shenzhen.aliyuncs.com/acs/pause:3.1
             pullPolicy: IfNotPresent
             resources:
               requests:
                 cpu: 4            # Resources occupy 4C8G.
                 memory: 8Gi
         imagePullSecrets: {}
         annotations: {}
         nodeSelector:        # Node selection, consistent with the labels of the elastic node pool.
           demo: "yes"  
         tolerations: []
         affinity: {}
         labels: {}

    After creation, go to the Applications > Helm page and verify that the application status is Deployed.

Step 2: Create a PriorityClass for the actual workload

  1. Create a file named priorityClass.yaml using the following YAML example.

    apiVersion: scheduling.k8s.io/v1
    kind: PriorityClass
    metadata:
      name: high-priority
    value: 1000000       # Configure the priority, which must be higher than the default priority of the placeholder Pod in the previous step.
    globalDefault: false
    description: "This priority class should be used for XYZ service pods only."
  2. Run the following command to deploy the PriorityClass for the actual workload.

    kubectl apply -f priorityClass.yaml

    Expected output:

    priorityclass.scheduling.k8s.io/high-priority created

Step 3: Create the actual workload

  1. Create a file named workload.yaml using the following YAML example.

    View YAML Example

    apiVersion: apps/v1 
    kind: Deployment
    metadata:
      name: placeholder-test
      labels:
        app: nginx
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: nginx
      template:
        metadata:
          labels:
            app: nginx
        spec:
          nodeSelector:    # Node selection, consistent with the labels of the elastic node pool.
            demo: "yes"
          priorityClassName: high-priority     # Set this to the PriorityClass name configured in the previous step.
          containers:
          - name: nginx
            image: anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis/nginx:1.14.1-8.6 
            ports:
            - containerPort: 80
            resources:       
              requests:      
                cpu: 3         # Resource requests for the actual workload.
                memory: 5Gi
  2. Run the following command to deploy the actual workload.

    kubectl apply -f workload.yaml

    Expected output:

    deployment.apps/placeholder-test created

Result Verification

  1. After the placeholder workload ack-place-holder is created, its Pod status is Running.

    image

  2. When the actual workload is deployed, it preempts resources from the placeholder workload for quick startup because a high-priority PriorityClass is configured. The placeholder workload's Pod is evicted and remains in a Pending state due to insufficient node resources.

    • The actual workload placeholder-test deploys quickly on the same node where the placeholder workload resides.

      image

    • The placeholder workload is evicted and enters a Pending state.

      image

  3. Because the node pool has auto-scaling enabled, insufficient node resources trigger node scale-out. The placeholder workload is scheduled to the newly scaled-out node, and its status becomes Running.

    image

References

For elastic scale-out with multi-zone deployment in high availability scenarios, see Achieve Fast Elastic Scale-out in Multiple Zones Simultaneously.