Container Timing Horizontal Scaling (CronHPA)

CCE CCE

  • Function Release Records
  • Common Tools
    • Command Line Scenario Examples
  • API Reference
    • Overview
    • Common Headers and Error Responses
    • General Description
  • Product Announcement
    • Announcement on the Discontinuation of CCE Standalone Clusters
    • CCE New Cluster Management Release Announcement
    • Upgrade Announcement for CCE Cluster Audit Component kube-external-auditor
    • CCE Console Upgrade Announcement
    • Announcement on Management Fees for CCE Managed Clusters
    • Container Runtime Version Release Notes
    • Announcement on the Decommissioning of CCE Image Repository
    • Kubernetes Version Release Notes
      • CCE Release of Kubernetes v1_26 History
      • CCE Kubernetes Version Update Notes
      • CCE Release of Kubernetes v1_24 History
      • CCE Release of Kubernetes v1_30 History
      • CCE Release of Kubernetes v1_22 History
      • CCE Release of Kubernetes v1_18 History
      • CCE Release of Kubernetes v1_20 History
      • CCE Release of Kubernetes v1_28 History
      • Release Notes for CCE Kubernetes 1_31 Version
      • Kubernetes Version Overview and Mechanism
    • Security Vulnerability Fix Announcement
      • Vulnerability CVE-2019-5736 Fix Announcement
      • Vulnerability CVE-2021-30465 Fix Announcement
      • CVE-2025-1097, CVE-2025-1098, and Other Vulnerabilities Fix Announcement
      • CVE-2020-14386 Vulnerability Fix Announcement
      • Impact Statement on runc Security Issue (CVE-2024-21626)
  • Service Level Agreement (SLA)
    • CCE Service Level Agreement SLA (V1_0)
  • Typical Practices
    • Pod Anomaly Troubleshooting
    • Adding CGroup V2 Node
    • Common Linux System Configuration Parameters Description
    • Encrypting etcd Data Using KMS
    • Configuring Container Network Parameters Using CNI
    • CCE - Public Network Access Practice
    • Practice of using private images in CCE clusters
    • Unified Access for Virtual Machines and Container Services via CCE Ingress
    • User Guide for Custom CNI Plugins
    • CCE Cluster Network Description and Planning
    • Cross-Cloud Application Migration to Baidu CCE Using Velero
    • CCE Resource Recommender User Documentation
    • Continuous Deployment with Jenkins in CCE Cluster
    • CCE Best Practice-Guestbook Setup
    • CCE Best Practice-Container Network Mode Selection
    • CCE Usage Checklist
    • VPC-ENI Mode Cluster Public Network Access Practice
    • CCE Container Runtime Selection
    • Cloud-native AI
      • Elastic and Fault-Tolerant Training Using CCE AITraining Operator
      • Deploy the TensorFlow Serving inference service
      • Best Practice for GPU Virtualization with Optimal Isolation
  • FAQs
    • How do business applications use load balancer
    • Using kubectl on Windows
    • Cluster management FAQs
    • Common Questions Overview
    • Auto scaling FAQs
    • Create a simple service via kubectl
  • Operation guide
    • Prerequisites for use
    • Identity and access management
    • Permission Management
      • Configure IAM Tag Permission Policy
      • Permission Overview
      • Configure IAM Custom Permission Policy
      • Configure Predefined RBAC Permission Policy
      • Configure IAM Predefined Permission Policy
      • Configure Cluster OIDC Authentication
    • Configuration Management
      • Configmap Management
      • Secret Management
    • Traffic access
      • BLB ingress annotation description
      • Use K8S_Service via CCE
      • Use K8S_Ingress via CCE
      • Implement Canary Release with CCE Based on Nginx-Ingress
      • Create CCE_Ingress via YAML
      • LoadBalancer Service Annotation Description
      • Service Reuses Existing Load Balancer BLB
      • Use Direct Pod Mode LoadBalancer Service
      • NGINX Ingress Configuration Reference
      • Create LoadBalancer_Service via YAML
      • Use NGINX Ingress
    • Virtual Node
      • Configuring BCIPod
      • Configuring bci-profile
      • Managing virtual nodes
    • Node management
      • Add a node
      • Managing Taints
      • Setting Node Blocking
      • Setting GPU Memory Sharing
      • Remove a node
      • Customizing Kubelet Parameters
      • Kubelet Container Monitor Read-Only Port Risk Warning
      • Managing Node Tag
      • Drain node
    • Component Management
      • CCE CSI CDS Plugin Description
      • CCE Fluid Description
      • CCE CSI PFS L2 Plugin
      • CCE Calico Felix Description
      • CCE Ingress Controller Description
      • CCE QoS Agent Description
      • CCE GPU Manager Description
      • CCE Ingress NGINX Controller Description
      • CCE P2P Accelerator Description
      • CCE Virtual Kubelet Component
      • CoreDNS Description
      • CCE Log Operator Description
      • CCE Node Remedier Description
      • CCE Descheduler Description
      • CCE Dynamic Scheduling Plugin Description
      • Kube Scheduler Documentation
      • CCE NPU Manager Description
      • CCE CronHPA Controller Description
      • CCE LB Controller Description
      • Kube ApiServer Description
      • CCE Backup Controller Description
      • CCE Network Plugin Description
      • CCE CSI PFS Plugin Description
      • CCE Credential Controller Description
      • CCE Deep Learning Frameworks Operator Description
      • Component Overview
      • CCE Image Accelerate Description
      • CCE CSI BOS Plugin Description
      • CCE Onepilot Description
      • Description of Kube Controller Manager
      • CCE_Hybrid_Manager Description
      • CCE NodeLocal DNSCache Description
      • CCE Node Problem Detector Description
      • CCE Ascend Mindx DL Description
      • CCE RDMA Device Plugin Description
      • CCE AI Job Scheduler Description
    • Image registry
      • Image Registry Basic Operations
      • Using Container Image to Build Services
    • Helm Management
      • Helm Template
      • Helm Instance
    • Cluster management
      • Upgrade Cluster Kubernetes Version
      • CCE Node CDS Dilatation
      • Managed Cluster Usage Instructions
      • Create cluster
      • CCE Supports GPUSharing Cluster
      • View Cluster
      • Connect to Cluster via kubectl
      • CCE Security Group
      • CCE Node Resource Reservation Instructions
      • Operate Cluster
      • Cluster Snapshot
    • Serverless Cluster
      • Product overview
      • Using Service in Serverless Cluster
      • Creating a Serverless Cluster
    • Storage Management
      • Using Cloud File System
      • Overview
      • Using Parallel File System PFS
      • Using RapidFS
      • Using Object Storage BOS
      • Using Parallel File System PFS L2
      • Using Local Storage
      • Using Cloud Disk CDS
    • Inspection and Diagnosis
      • Cluster Inspection
      • GPU Runtime Environment Check
      • Fault Diagnosis
    • Cloud-native AI
      • Cloud-Native AI Overview
      • AI Monitoring Dashboard
        • Connecting to a Prometheus Instance and Starting a Job
        • NVIDIA Chip Resource Observation
          • AI Job Scheduler component
          • GPU node resources
          • GPU workload resources
          • GPUManager component
          • GPU resource pool overview
        • Ascend Chip Resource Observation
          • Ascend resource pool overview
          • Ascend node resource
          • Ascend workload resource
      • Task Management
        • View Task Information
        • Create TensorFlow Task
        • Example of RDMA Distributed Training Based on NCCL
        • Create PaddlePaddle Task
        • Create AI Training Task
        • Delete task
        • Create PyTorch Task
        • Create Mxnet Task
      • Queue Management
        • Modify Queue
        • Create Queue
        • Usage Instructions for Logical Queues and Physical Queues
        • Queue deletion
      • Dataset Management
        • Create Dataset
        • Delete dataset
        • View Dataset
        • Operate Dataset
      • AI Acceleration Kit
        • AIAK Introduction
        • Using AIAK-Training PyTorch Edition
        • Deploying Distributed Training Tasks Using AIAK-Training
        • Accelerating Inference Business Using AIAK-Inference
      • GPU Virtualization
        • GPU Exclusive and Shared Usage Instructions
        • Image Build Precautions in Shared GPU Scenarios
        • Instructions for Multi-GPU Usage in Single-GPU Containers
        • GPU Virtualization Adaptation Table
        • GPU Online and Offline Mixed Usage Instructions
        • MPS Best Practices & Precautions
        • Precautions for Disabling Node Video Memory Sharing
    • Elastic Scaling
      • Container Timing Horizontal Scaling (CronHPA)
      • Container Horizontal Scaling (HPA)
      • Implementing Second-Level Elastic Scaling with cce-autoscaling-placeholder
      • CCE Cluster Node Auto-Scaling
    • Network Management
      • How to Continue Dilatation When Container Network Segment Space Is Exhausted (VPC-ENI Mode)
      • Container Access to External Services in CCE Clusters
      • CCE supports dual-stack networks of IPv4 and IPv6
      • Using NetworkPolicy Network Policy
      • Traffic Forwarding Configuration for Containers in Peering Connections Scenarios
      • CCE IP Masquerade Agent User Guide
      • Creating VPC-ENI Mode Cluster
      • How to Continue Dilatation When Container Network Segment Space Is Exhausted (VPC Network Mode)
      • Using NetworkPolicy in CCE Clusters
      • Network Orchestration
        • Container Network QoS Management
        • VPC-ENI Specified Subnet IP Allocation (Container Network v2)
        • Cluster Pod Subnet Topology Distribution (Container Network v2)
      • Network Connectivity
        • Container network accesses the public network via NAT gateway
      • Network Maintenance
        • Common Error Code Table for CCE Container Network
      • DNS
        • CoreDNS Component Manual Dilatation Guide
        • DNS Troubleshooting Guide
        • DNS Principle Overview
    • Namespace Management
      • Set Limit Range
      • Set Resource Quota
      • Basic Namespace Operations
    • Workload
      • CronJob Management
      • Set Workload Auto-Scaling
      • Deployment Management
      • Job Management
      • View the Pod
      • StatefulSet Management
      • Password-Free Pull of Container Image
      • Create Workload Using Private Image
      • DaemonSet Management
    • Monitor Logs
      • Monitor Cluster with Prometheus
      • CCE Event Center
      • Cluster Service Profiling
      • CCE Cluster Anomaly Event Alerts
      • Java Application Monitor
      • Cluster Audit Dashboard
      • Logging
      • Cluster Audit
      • Log Center
        • Configure Collection Rules Using CRD
        • View Cluster Control Plane Logs
        • View Business Logs
        • Log Overview
        • Configure Collection Rules in Cloud Container Engine Console
    • Application management
      • Overview
      • Secret
      • Configuration dictionary
      • Deployment
      • Service
      • Pod
    • NodeGroup Management
      • NodeGroup Management
      • NodeGroup Node Fault Detection and Self-Healing
      • Configuring Scaling Policies
      • NodeGroup Introduction
      • Adding Existing External Nodes
      • Custom NodeGroup Kubelet Configuration
      • Adding Alternative Models
      • Dilatation NodeGroup
    • Backup Center
      • Restore Management
      • Backup Overview
      • Backup Management
      • Backup repository
  • Quick Start
    • Quick Deployment of Nginx Application
    • CCE Container Engine Usage Process Overview
  • Product pricing
    • Product pricing
  • Product Description
    • Application scenarios
    • Introduction
    • Usage restrictions
    • Features
    • Advantages
    • Core concepts
  • Solution-Fabric
    • Fabric Solution
  • Development Guide
    • EFK Log Collection System Deployment Guide
    • Using Network Policy in CCE Cluster
    • Creating a LoadBalancer-Type Service
    • Prometheus Monitoring System Deployment Guide
    • kubectl Management Configuration
  • API_V2 Reference
    • Overview
    • Common Headers and Error Responses
    • Cluster Related Interfaces
    • Instance Related Interfaces
    • Service domain
    • General Description
    • Kubeconfig Related Interfaces
    • RBAC Related Interfaces
    • Autoscaler Related Interfaces
    • Network Related Interfaces
    • InstanceGroup Related Interfaces
    • Appendix
    • Component management-related APIs
    • Package adaptation-related APIs
    • Task Related Interfaces
  • Solution-Xchain
    • Hyperchain Solution
  • SDK
    • Go-SDK
      • Overview
      • NodeGroup Management
      • Initialization
      • Install the SDK Package
      • Cluster management
      • Node management
All documents
menu
No results found, please re-enter

CCE CCE

  • Function Release Records
  • Common Tools
    • Command Line Scenario Examples
  • API Reference
    • Overview
    • Common Headers and Error Responses
    • General Description
  • Product Announcement
    • Announcement on the Discontinuation of CCE Standalone Clusters
    • CCE New Cluster Management Release Announcement
    • Upgrade Announcement for CCE Cluster Audit Component kube-external-auditor
    • CCE Console Upgrade Announcement
    • Announcement on Management Fees for CCE Managed Clusters
    • Container Runtime Version Release Notes
    • Announcement on the Decommissioning of CCE Image Repository
    • Kubernetes Version Release Notes
      • CCE Release of Kubernetes v1_26 History
      • CCE Kubernetes Version Update Notes
      • CCE Release of Kubernetes v1_24 History
      • CCE Release of Kubernetes v1_30 History
      • CCE Release of Kubernetes v1_22 History
      • CCE Release of Kubernetes v1_18 History
      • CCE Release of Kubernetes v1_20 History
      • CCE Release of Kubernetes v1_28 History
      • Release Notes for CCE Kubernetes 1_31 Version
      • Kubernetes Version Overview and Mechanism
    • Security Vulnerability Fix Announcement
      • Vulnerability CVE-2019-5736 Fix Announcement
      • Vulnerability CVE-2021-30465 Fix Announcement
      • CVE-2025-1097, CVE-2025-1098, and Other Vulnerabilities Fix Announcement
      • CVE-2020-14386 Vulnerability Fix Announcement
      • Impact Statement on runc Security Issue (CVE-2024-21626)
  • Service Level Agreement (SLA)
    • CCE Service Level Agreement SLA (V1_0)
  • Typical Practices
    • Pod Anomaly Troubleshooting
    • Adding CGroup V2 Node
    • Common Linux System Configuration Parameters Description
    • Encrypting etcd Data Using KMS
    • Configuring Container Network Parameters Using CNI
    • CCE - Public Network Access Practice
    • Practice of using private images in CCE clusters
    • Unified Access for Virtual Machines and Container Services via CCE Ingress
    • User Guide for Custom CNI Plugins
    • CCE Cluster Network Description and Planning
    • Cross-Cloud Application Migration to Baidu CCE Using Velero
    • CCE Resource Recommender User Documentation
    • Continuous Deployment with Jenkins in CCE Cluster
    • CCE Best Practice-Guestbook Setup
    • CCE Best Practice-Container Network Mode Selection
    • CCE Usage Checklist
    • VPC-ENI Mode Cluster Public Network Access Practice
    • CCE Container Runtime Selection
    • Cloud-native AI
      • Elastic and Fault-Tolerant Training Using CCE AITraining Operator
      • Deploy the TensorFlow Serving inference service
      • Best Practice for GPU Virtualization with Optimal Isolation
  • FAQs
    • How do business applications use load balancer
    • Using kubectl on Windows
    • Cluster management FAQs
    • Common Questions Overview
    • Auto scaling FAQs
    • Create a simple service via kubectl
  • Operation guide
    • Prerequisites for use
    • Identity and access management
    • Permission Management
      • Configure IAM Tag Permission Policy
      • Permission Overview
      • Configure IAM Custom Permission Policy
      • Configure Predefined RBAC Permission Policy
      • Configure IAM Predefined Permission Policy
      • Configure Cluster OIDC Authentication
    • Configuration Management
      • Configmap Management
      • Secret Management
    • Traffic access
      • BLB ingress annotation description
      • Use K8S_Service via CCE
      • Use K8S_Ingress via CCE
      • Implement Canary Release with CCE Based on Nginx-Ingress
      • Create CCE_Ingress via YAML
      • LoadBalancer Service Annotation Description
      • Service Reuses Existing Load Balancer BLB
      • Use Direct Pod Mode LoadBalancer Service
      • NGINX Ingress Configuration Reference
      • Create LoadBalancer_Service via YAML
      • Use NGINX Ingress
    • Virtual Node
      • Configuring BCIPod
      • Configuring bci-profile
      • Managing virtual nodes
    • Node management
      • Add a node
      • Managing Taints
      • Setting Node Blocking
      • Setting GPU Memory Sharing
      • Remove a node
      • Customizing Kubelet Parameters
      • Kubelet Container Monitor Read-Only Port Risk Warning
      • Managing Node Tag
      • Drain node
    • Component Management
      • CCE CSI CDS Plugin Description
      • CCE Fluid Description
      • CCE CSI PFS L2 Plugin
      • CCE Calico Felix Description
      • CCE Ingress Controller Description
      • CCE QoS Agent Description
      • CCE GPU Manager Description
      • CCE Ingress NGINX Controller Description
      • CCE P2P Accelerator Description
      • CCE Virtual Kubelet Component
      • CoreDNS Description
      • CCE Log Operator Description
      • CCE Node Remedier Description
      • CCE Descheduler Description
      • CCE Dynamic Scheduling Plugin Description
      • Kube Scheduler Documentation
      • CCE NPU Manager Description
      • CCE CronHPA Controller Description
      • CCE LB Controller Description
      • Kube ApiServer Description
      • CCE Backup Controller Description
      • CCE Network Plugin Description
      • CCE CSI PFS Plugin Description
      • CCE Credential Controller Description
      • CCE Deep Learning Frameworks Operator Description
      • Component Overview
      • CCE Image Accelerate Description
      • CCE CSI BOS Plugin Description
      • CCE Onepilot Description
      • Description of Kube Controller Manager
      • CCE_Hybrid_Manager Description
      • CCE NodeLocal DNSCache Description
      • CCE Node Problem Detector Description
      • CCE Ascend Mindx DL Description
      • CCE RDMA Device Plugin Description
      • CCE AI Job Scheduler Description
    • Image registry
      • Image Registry Basic Operations
      • Using Container Image to Build Services
    • Helm Management
      • Helm Template
      • Helm Instance
    • Cluster management
      • Upgrade Cluster Kubernetes Version
      • CCE Node CDS Dilatation
      • Managed Cluster Usage Instructions
      • Create cluster
      • CCE Supports GPUSharing Cluster
      • View Cluster
      • Connect to Cluster via kubectl
      • CCE Security Group
      • CCE Node Resource Reservation Instructions
      • Operate Cluster
      • Cluster Snapshot
    • Serverless Cluster
      • Product overview
      • Using Service in Serverless Cluster
      • Creating a Serverless Cluster
    • Storage Management
      • Using Cloud File System
      • Overview
      • Using Parallel File System PFS
      • Using RapidFS
      • Using Object Storage BOS
      • Using Parallel File System PFS L2
      • Using Local Storage
      • Using Cloud Disk CDS
    • Inspection and Diagnosis
      • Cluster Inspection
      • GPU Runtime Environment Check
      • Fault Diagnosis
    • Cloud-native AI
      • Cloud-Native AI Overview
      • AI Monitoring Dashboard
        • Connecting to a Prometheus Instance and Starting a Job
        • NVIDIA Chip Resource Observation
          • AI Job Scheduler component
          • GPU node resources
          • GPU workload resources
          • GPUManager component
          • GPU resource pool overview
        • Ascend Chip Resource Observation
          • Ascend resource pool overview
          • Ascend node resource
          • Ascend workload resource
      • Task Management
        • View Task Information
        • Create TensorFlow Task
        • Example of RDMA Distributed Training Based on NCCL
        • Create PaddlePaddle Task
        • Create AI Training Task
        • Delete task
        • Create PyTorch Task
        • Create Mxnet Task
      • Queue Management
        • Modify Queue
        • Create Queue
        • Usage Instructions for Logical Queues and Physical Queues
        • Queue deletion
      • Dataset Management
        • Create Dataset
        • Delete dataset
        • View Dataset
        • Operate Dataset
      • AI Acceleration Kit
        • AIAK Introduction
        • Using AIAK-Training PyTorch Edition
        • Deploying Distributed Training Tasks Using AIAK-Training
        • Accelerating Inference Business Using AIAK-Inference
      • GPU Virtualization
        • GPU Exclusive and Shared Usage Instructions
        • Image Build Precautions in Shared GPU Scenarios
        • Instructions for Multi-GPU Usage in Single-GPU Containers
        • GPU Virtualization Adaptation Table
        • GPU Online and Offline Mixed Usage Instructions
        • MPS Best Practices & Precautions
        • Precautions for Disabling Node Video Memory Sharing
    • Elastic Scaling
      • Container Timing Horizontal Scaling (CronHPA)
      • Container Horizontal Scaling (HPA)
      • Implementing Second-Level Elastic Scaling with cce-autoscaling-placeholder
      • CCE Cluster Node Auto-Scaling
    • Network Management
      • How to Continue Dilatation When Container Network Segment Space Is Exhausted (VPC-ENI Mode)
      • Container Access to External Services in CCE Clusters
      • CCE supports dual-stack networks of IPv4 and IPv6
      • Using NetworkPolicy Network Policy
      • Traffic Forwarding Configuration for Containers in Peering Connections Scenarios
      • CCE IP Masquerade Agent User Guide
      • Creating VPC-ENI Mode Cluster
      • How to Continue Dilatation When Container Network Segment Space Is Exhausted (VPC Network Mode)
      • Using NetworkPolicy in CCE Clusters
      • Network Orchestration
        • Container Network QoS Management
        • VPC-ENI Specified Subnet IP Allocation (Container Network v2)
        • Cluster Pod Subnet Topology Distribution (Container Network v2)
      • Network Connectivity
        • Container network accesses the public network via NAT gateway
      • Network Maintenance
        • Common Error Code Table for CCE Container Network
      • DNS
        • CoreDNS Component Manual Dilatation Guide
        • DNS Troubleshooting Guide
        • DNS Principle Overview
    • Namespace Management
      • Set Limit Range
      • Set Resource Quota
      • Basic Namespace Operations
    • Workload
      • CronJob Management
      • Set Workload Auto-Scaling
      • Deployment Management
      • Job Management
      • View the Pod
      • StatefulSet Management
      • Password-Free Pull of Container Image
      • Create Workload Using Private Image
      • DaemonSet Management
    • Monitor Logs
      • Monitor Cluster with Prometheus
      • CCE Event Center
      • Cluster Service Profiling
      • CCE Cluster Anomaly Event Alerts
      • Java Application Monitor
      • Cluster Audit Dashboard
      • Logging
      • Cluster Audit
      • Log Center
        • Configure Collection Rules Using CRD
        • View Cluster Control Plane Logs
        • View Business Logs
        • Log Overview
        • Configure Collection Rules in Cloud Container Engine Console
    • Application management
      • Overview
      • Secret
      • Configuration dictionary
      • Deployment
      • Service
      • Pod
    • NodeGroup Management
      • NodeGroup Management
      • NodeGroup Node Fault Detection and Self-Healing
      • Configuring Scaling Policies
      • NodeGroup Introduction
      • Adding Existing External Nodes
      • Custom NodeGroup Kubelet Configuration
      • Adding Alternative Models
      • Dilatation NodeGroup
    • Backup Center
      • Restore Management
      • Backup Overview
      • Backup Management
      • Backup repository
  • Quick Start
    • Quick Deployment of Nginx Application
    • CCE Container Engine Usage Process Overview
  • Product pricing
    • Product pricing
  • Product Description
    • Application scenarios
    • Introduction
    • Usage restrictions
    • Features
    • Advantages
    • Core concepts
  • Solution-Fabric
    • Fabric Solution
  • Development Guide
    • EFK Log Collection System Deployment Guide
    • Using Network Policy in CCE Cluster
    • Creating a LoadBalancer-Type Service
    • Prometheus Monitoring System Deployment Guide
    • kubectl Management Configuration
  • API_V2 Reference
    • Overview
    • Common Headers and Error Responses
    • Cluster Related Interfaces
    • Instance Related Interfaces
    • Service domain
    • General Description
    • Kubeconfig Related Interfaces
    • RBAC Related Interfaces
    • Autoscaler Related Interfaces
    • Network Related Interfaces
    • InstanceGroup Related Interfaces
    • Appendix
    • Component management-related APIs
    • Package adaptation-related APIs
    • Task Related Interfaces
  • Solution-Xchain
    • Hyperchain Solution
  • SDK
    • Go-SDK
      • Overview
      • NodeGroup Management
      • Initialization
      • Install the SDK Package
      • Cluster management
      • Node management
  • Document center
  • arrow
  • CCECCE
  • arrow
  • Operation guide
  • arrow
  • Elastic Scaling
  • arrow
  • Container Timing Horizontal Scaling (CronHPA)
Table of contents on this page
  • Prerequisites
  • Operation steps
  • Use CronHPA through the console
  • Method I: Enable CronHPA for an existing workload
  • Method II: Enable CronHPA during the creation of a workload
  • Use CronHPA through kubectl commands
  • Introduction to deployment parameters
  • Special symbol description
  • Example of cron
  • Example of CronHPA scaling deployment
  • Example of CronHPA compatibility with HPA

Container Timing Horizontal Scaling (CronHPA)

Updated at:2025-10-27

In predictable service scenarios, you can predefine scheduled scaling tasks to increase the number of working containers before service peaks, thereby minimizing the workload for operations and maintenance teams. Currently, CCE supports setting scheduled scaling tasks for Deployment and StatefulSet, with an option to combine scheduled scaling with HPA, significantly broadening the scope of auto-scaling use cases.

Prerequisites

  • A K8S Cluster CCE has been created. For specific operations, refer to Create a K8S Cluster CCE.
  • The CCE-CronHPA-Controller component has been installed. For specific operations, please refer to CCE CronHPA Controller Description.

Operation steps

Use CronHPA through the console

Method I: Enable CronHPA for an existing workload

  1. Sign in to the Baidu AI Cloud management console. Navigate to Product Services > Cloud Native > Cloud Container Engine (CCE). Click Cluster Management > Cluster List, then select the target cluster to enter the Cluster Details page. In the sidebar, click Autoscaler > CronHPA.
  2. Click the Create Cron Horizontal Pod Autoscaler operation on the Cron Horizontal Pod Autoscaler page.
  3. Set up the scaling configurations on the Create Cron Horizontal Pod Autoscaler page.
ConfigMap Required/Optional Configuration
Name Required Provide a name for the Cron Horizontal Pod Autoscaler. The name must be 1-63 characters long, consist of only numbers, lowercase letters, and hyphens ("-"), start with a letter, and end with a letter or number.
Namespace Required Choose the namespace where the Cron Horizontal Pod Autoscaler will be created.
Associated object type Required Support is available for configuring Cron Horizontal Pod Autoscaler for Deployment, StatefulSet, and Horizontal Pod Autoscaler (HPA).
Associated objects Required Select the desired Deployment, StatefulSet, and Horizontal Pod Autoscaler (HPA) resources for enabling the feature.
CornJob Required Configure the strategy for scheduled execution of scaling rules, and support adding multiple CornJobs.
Name: Specify the name of the scheduled task. It must be 1-63 characters long, contain only numbers, lowercase letters, and "-", and start with a letter and end with a number or a letter.
Scheduled rules: Enter the scheduled rule in the format: second minute hour day month week (for example: 1 2 3 4 * * means that the scaling task is executed once at 03:02:01 on the 4th day of each month). For more information, refer to go-cron.
One-time execution: Configure whether to enable the CornJob only once. If checked, the task will be executed only once. Target replica count: Specify the number of Pod instances for scaling.
Task skipping time Optional Define the time rules during which the task will not execute. When the specified time is matched, CronJob will not be triggered. The format is second minute hour day month week, with a minimum unit of day.
  1. Click OK to complete creation.

Method II: Enable CronHPA during the creation of a workload

Taking the creation of a stateless deployment as an example:

  1. Sign in to the Baidu AI Cloud management console. Navigate to Product Services - Cloud Native - Cloud Container Engine (CCE). Click Cluster Management - Cluster List, then select the target cluster to enter the Cluster Details page. In the sidebar, click Workloads > Stateless Deployment.
  2. Click the Create Stateless Deployment operation on the Stateless Deployment page.
  3. On the Create Stateless Deployment - Advanced Settings page, check Cron Horizontal Pod Autoscaler to enable Cron Horizontal Pod Autoscaler (CronHPA) for the workload.
ConfigMap Required/Optional Configuration
Name Required Provide a name for the Cron Horizontal Pod Autoscaler. The name must be 1-63 characters long, consist of only numbers, lowercase letters, and hyphens ("-"), start with a letter, and end with a letter or number.
Namespace Required Choose the namespace where the Cron Horizontal Pod Autoscaler will be created.
Associated object type Required Support is available for configuring Cron Horizontal Pod Autoscaler for Deployment, StatefulSet, and Horizontal Pod Autoscaler (HPA).
Associated objects Required Select the desired Deployment, StatefulSet, and Horizontal Pod Autoscaler (HPA) resources for enabling the feature.
CornJob Required Configure the strategy for scheduled execution of scaling rules, and support adding multiple CornJobs.
Name: Specify the name of the scheduled task. It must be 1-63 characters long, contain only numbers, lowercase letters, and "-", and start with a letter and end with a number or a letter.
Scheduled rules: Enter the scheduled rule in the format: second minute hour day month week (for example: 1 2 3 4 * * means that the scaling task is executed once at 03:02:01 on the 4th day of each month). For more information, refer to go-cron.
One-time execution: Configure whether to enable the CornJob only once. If checked, the task will be executed only once. Target replica count: Specify the number of Pod instances for scaling.
Task skipping time Optional Define the time rules during which the task will not execute. When the specified time is matched, CronJob will not be triggered. The format is second minute hour day month week, with a minimum unit of day.
  1. Click Finish, and then a stateless deployment supporting CronHPA has been configured.

Use CronHPA through kubectl commands

The following is a specific CronHPA example:

Plain Text
1apiVersion: cce.baidubce.com/v1
2kind: CronHPA
3metadata:
4  name: cronhpa-sample
5spec:
6   scaleTargetRef:
7      apiVersion: apps/v1
8      kind: Deployment
9      name: nginx-deployment-basic
10   excludeDates:
11   - "* * * 15 11 *"
12   - "* * * 1 11 *"
13   crons:
14   - name: "scale-down"
15     schedule: "30 */1 * * * *"
16     targetSize: 1
17     runOnce: true
18   - name: "scale-up"
19     schedule: "01 */1 * * * *"
20     targetSize: 3

Introduction to deployment parameters

Name Function Required or not
spec.scaleTargetRef Metadata of the expected scaling object Required
crons.name Task name Required
crons.schedule Time of task triggering Required
crons.runOnce One-time execution of the task Optional
crons.targetSize Expected replica count Required
spec.excludeDates Time of task not triggering Optional

Among them, schedule and excludeDates need to be configured in the following format:

Field name Required or not Allowed values Allowed special characters
Seconds Yes 0-59 */,-
Minutes Yes 0-59 */,-
Hours Yes 0-23 */,-
Day of month Yes 1-31 */,-?
Month Yes 1-12 or JAN-DEC */,-
Day of week Yes 0-6 or SUN-SAT */,-?

Special symbol description

  • An asterisk (*) indicates that the field can match all possible values. For example, if an asterisk is used in the 5th field (month), it signifies every month.
  • Slash (/) indicates an increment interval. For example, if the value of the first field (minutes) is 3-59/15, it means execution starts at the 3rd minute of each hour and repeats once every 15 minutes thereafter (i.e., executed at 3, 18, 33, 48 timepoints). This can also be expressed as: 3/15
  • A comma (,) is used to specify enumerated values. For instance, if the value in the 6th field is MON,WED,FRI, it denotes execution on Monday, Wednesday, and Friday.
  • Hyphen (-) indicates a range. For example, value of 9-17 in the third field means every hour from 9 am to 5 pm (including 9 and 17)
  • Question mark (?) is only used for day of month and day of week. \ indicates no specified value and can be used to replace *

Example of cron

  • Execute every 5 seconds: /5 * * * ?
  • Execute every 1 minute: 0 /1 * * ?
  • Execute once daily at 23:00: 0 0 23 * * ?
  • Execute once daily at 1:00 AM: 0 0 1 * * ?
  • Execute once at 1:00 AM on the 1st day of each month: 0 0 1 1 * ?
  • Execute once at the 26th, 29th and 33rd minutes of each hour: 0 26,29,33 * * * ?
  • Execute daily at 0:00, 13:00, 18:00, and 21:00: 0 0 0,13,18,21 * * ?

Example of CronHPA scaling deployment

To apply CronHPA to a normal workload, you only need to configure the spec.scaleTargetRef field to the information of the workload. The following is a specific example of CronHPA scaling deployment:

YAML
1---
2apiVersion: apps/v1
3kind: Deployment
4metadata:
5  name: nginx-deployment-basic
6  labels:
7    app: nginx
8spec:
9  replicas: 2
10  selector:
11    matchLabels:
12      app: nginx
13  template:
14    metadata:
15      labels:
16        app: nginx
17    spec:
18      containers:
19      - name: nginx
20        image: nginx
21        ports:
22        - containerPort: 80
23---
24apiVersion: cce.baidubce.com/v1
25kind: CronHPA
26metadata:
27  name: cronhpa-sample
28spec:
29 scaleTargetRef: //Configure to the information of the above deployment
30    apiVersion: apps/v1
31    kind: Deployment
32    name: nginx-deployment-basic
33  crons:
34  - name: "scale-down"
35    schedule: "30 */1 * * * *"
36    targetSize: 1
37  - name: "scale-up"
38    schedule: "01 */1 * * * *"
39    targetSize: 3

Example of CronHPA compatibility with HPA

It can be seen from the template definitions of CronHPA and HPA:

  • Both CronHPA and HPA access the scaling object through the scaleTargetRef field.
  • CronHPA adjusts the replica count periodically based on crontab rules.
  • HPA determines scaling requirements based on resource utilization.

If both CronHPA and HPA are set, there will be a scenario where CronHPA and HPA operate on the same scaleTargetRef at the same time. CronHPA and HPA are independent of each other and cannot perceive each other. The later operation will overwrite the earlier one. For example, after a scheduled scale-up is completed, it may be scaled down due to low resource utilization. Therefore, when the object to be scaled is referenced by HPA, to avoid conflicts between HPA and CronHPA that cause the result to be overwritten, you need to configure spec.scaleTargetRef to the corresponding HPA object. In this way, CronHPA can perceive the status of HPA and adjust the replica count by adjusting the upper and lower limits of HPA.

image

Here are some specific scenario examples that are compatible with CronHPA and HPA to achieve scheduled scaling:

HPA(min/max) CronHPA deployment result Description
1/10 5 5 HPA(1/10) deployment 5 The expected replica count of CronHPA is fixed and consistent, without change
1/10 4 5 HPA(1/10) deployment 5 The current replica count is 5, which is higher than the expected replica count (4) of CronHPA; the expected replica count is within the range [1,10], without change
1/10 6 5 HPA(6/10) deployment 6 The expected replica count of CronHPA is 6, which is higher than the current replica count (5). Adjust the HPA lower limit to automatically scale up the replica count to 6
5/10 4 5 HPA(4/10) deployment 5 The expected replica count of CronHPA is lower than the current replica count (5). Keep the current replica count. The expected replica count of CronHPA is lower than the HPA lower limit. Modify the HPA lower limit (ensure at least 4 replicas)
5/10 11 5 HPA(11/11) deployment 11 The expected replica count of CronHPA is higher than the HPA upper limit. Modify the HPA lower limit to the expected replica count of CronHPA. The upper limit is the same as the lower limit

The following is a specific yaml example of CronHPA compatible with HPA:

YAML
1---
2apiVersion: autoscaling/v1
3kind: HorizontalPodAutoscaler
4metadata:
5  name: nginx-deployment-basic-hpa
6  namespace: default
7spec:
8  scaleTargetRef:
9    apiVersion: apps/v1
10    kind: Deployment
11    name: nginx-deployment-basic
12  minReplicas: 1
13  maxReplicas: 10
14  targetCPUUtilizationPercentage: 50
15---
16apiVersion: cce.baidubce.com/v1
17kind: CronHPA
18metadata:
19  name: cronhpa-sample
20spec:
21 scaleTargetRef:// Configure to the HPA object
22    apiVersion: autoscaling/v1
23    kind: HorizontalPodAutoscaler
24    name: nginx-deployment-basic-hpa
25  crons:
26    - name: "scale-down"
27      schedule: "30 */1 * * * *"
28      targetSize: 5
29      runOnce: false
30    - name: "scale-up"
31      schedule: "01 */1 * * * *"
32      targetSize: 10
33      runOnce: false

Previous
Cloud-native AI
Next
Container Horizontal Scaling (HPA)