On-demand and scheduled scaling for a Kubernetes deployment
You can use on-demand and scheduled scaling to scale up or scale down resource usage (such as CPU and memory) without adjusting the configuration file (params.ini) by using the deployment scaler script (deployment-scaler-k8s.sh).
The deployment scaler script (deployment-scaler-k8s.sh) provides flexible resource management for your IBM® Concert deployment through multiple scaling approaches. You can scale resources immediately to respond to changing workload demands, or automate scaling operations with scheduled policies to align with predictable usage patterns.
- On-demand scaling to instantly adjust deployment resources.
- Schedule-based scaling to automate resource management with time-based policies using Kubernetes CronJobs.
- CronJob management to monitor, suspend, resume, and manage automated scaling schedules.
Before you begin
- You must have installed Concert on a Kubernetes cluster.
- You must have access to the namespace where Concert is installed.
- Download and extract the latest software package before you proceed with scaling:
- Download the latest software package by using the following command:
wget https://github.com/IBM/Concert/releases/download/v3.0.0/ibm-concert-x86.tar.gz - Extract the package by using the following command:
tar xfz ibm-concert-x86.tar.gz
- Download the latest software package by using the following command:
Viewing available script options
./ibm-concert/ibm-concert-k8s/deployment-scaler/deployment-scaler-k8s.sh -h
Scaling resources on-demand
Use on-demand scaling when you need to immediately adjust the resource allocation of your IBM Concert deployment to a specific scale level. This approach is recommended for responding to unexpected load changes or testing different configurations.
The scaler supports multiple predefined scale levels (level_0 to level_4), each with different replica counts and resource allocations for Concert components.
- To scale up or scale down the resource level by using on-demand, run the following command:
./ibm-concert/ibm-concert-k8s/deployment-scaler/deployment-scaler-k8s.sh \ --concert-namespace=<concert-namespace> \ --scale-level=<scale-level>Replace <concert-namespace> with the namespace where Concert is installed and <scale-level> with the required scale level (level_0 to level_4).
For example:- To scale up to a higher resource level_3, run the following command:
./ibm-concert/ibm-concert-k8s/deployment-scaler/deployment-scaler-k8s.sh \ --concert-namespace=<concert-namespace> \ --scale-level=level_3 - To scale down to a lower resource level_1, run the following command:
./ibm-concert/ibm-concert-k8s/deployment-scaler/deployment-scaler-k8s.sh \ --concert-namespace=<concert-namespace> \ --scale-level=level_1
- To scale up to a higher resource level_3, run the following command:
- To verify the status, run the following command:
kubectl get deploy -n <concert-namespace>Replace <concert-namespace> with the namespace where Concert is installed.
Results
The script adjusts all deployment resources according to the specified scale level.
Scheduling automated scaling operations
Use schedule-based scaling to automate resource management by creating Kubernetes CronJobs that scale your IBM Concert deployment at predefined times.
- Predictable workload patterns - Automatically scale up before business hours and scale down after hours.
- Cost efficiency - Reduce cloud infrastructure costs by minimizing resource usage during known low-activity periods such as nights and weekends.
- Hands-free operation - Configure once and let the system handle scaling automatically without manual intervention.
- Compliance with maintenance windows - Schedule scale-downs during backup or maintenance operations.
The script creates Kubernetes CronJob resources that execute scaling operations at the specified times. You can create multiple CronJobs for different scale levels throughout the day.
- To scale up or scale down the resource level by using schedule-based, run the following command:
./ibm-concert/ibm-concert-k8s/deployment-scaler/deployment-scaler-k8s.sh \ --concert-namespace=<concert-namespace> \ --scale-level=<scale-level> \ --schedule="<scheduled-time>"Replace <concert-namespace> with the namespace where Concert is installed, <scale-level> with the required scale level (level_0 to level_4), and <scheduled-time> with the required time for the scheduled scaling.
For example:- To schedule a scale-down operation at 10 PM daily, run the following command:
./ibm-concert/ibm-concert-k8s/deployment-scaler/deployment-scaler-k8s.sh \ --concert-namespace=<concert-namespace> \ --scale-level=level_1 \ --schedule="0 22 * * *" - To schedule a scale-up operation at 6 AM daily, run the following command:
./ibm-concert/ibm-concert-k8s/deployment-scaler/deployment-scaler-k8s.sh \ --concert-namespace=<concert-namespace> \ --scale-level=level_3 \ --schedule="0 6 * * *" - To schedule peak load scaling at 12 PM daily, run the following command:
./ibm-concert/ibm-concert-k8s/deployment-scaler/deployment-scaler-k8s.sh \ --concert-namespace=<concert-namespace> \ --scale-level=level_4 \ --schedule="0 12 * * *" - To replace an existing CronJob with a different scale level, add the
--forceparameter:./ibm-concert/ibm-concert-k8s/deployment-scaler/deployment-scaler-k8s.sh \ --concert-namespace=<concert-namespace> \ --scale-level=level_2 \ --schedule="0 22 * * *" \ --force
- To schedule a scale-down operation at 10 PM daily, run the following command:
- To verify the status, run the following command:
kubectl get cronjob -n <concert-namespace> | grep "scale-to-"Replace <concert-namespace> with the namespace where Concert is installed.
Results
The CronJob is created and will execute the scaling operation at the specified schedule.
Managing scheduled scaling operations
- To list all scaling CronJobs, run the following command:
./ibm-concert/ibm-concert-k8s/deployment-scaler/deployment-scaler-k8s.sh \ --concert-namespace=<concert-namespace> \ --action=listReplace <concert-namespace> with the namespace where Concert is installed.
- To suspend a CronJob without deleting it (useful during maintenance or testing), run the following command:
./ibm-concert/ibm-concert-k8s/deployment-scaler/deployment-scaler-k8s.sh \ --concert-namespace=<concert-namespace> \ --action=suspend \ --cronjob-name=<cron-job-name>Replace <concert-namespace> with the namespace where Concert is installed and <cron-job-name> with your CronJob name (for example,
scale-to-level-1-at-2200-cron). - To resume a suspended CronJob, run the following command:
./ibm-concert/ibm-concert-k8s/deployment-scaler/deployment-scaler-k8s.sh \ --concert-namespace=<concert-namespace> \ --action=resume \ --cronjob-name=<cron-job-name>Replace <concert-namespace> with the namespace where Concert is installed and <cron-job-name> with your CronJob name (for example,
scale-to-level-1-at-2200-cron). - To delete a specific CronJob that is no longer needed, run the following command:
./ibm-concert/ibm-concert-k8s/deployment-scaler/deployment-scaler-k8s.sh \ --concert-namespace=<concert-namespace> \ --action=delete \ --cronjob-name=<cron-job-name>Replace <concert-namespace> with the namespace where Concert is installed and <cron-job-name> with your CronJob name (for example,
scale-to-level-1-at-2200-cron). - To delete all scaling CronJobs at once, run the following command:
./ibm-concert/ibm-concert-k8s/deployment-scaler/deployment-scaler-k8s.sh \ --concert-namespace=<concert-namespace> \ --action=delete-allReplace <concert-namespace> with the namespace where Concert is installed.
- To verify the status, run the following command:
kubectl get cronjob <cron-job-name> -n <concert-namespace>Replace <cron-job-name> with your CronJob name (for example,
scale-to-level-1-at-2200-cron) and <concert-namespace> with the namespace where Concert is installed.