Auto-scaling¶
This page describes how to scale Open edX instance workloads in the cluster.
Overview¶
Scaling can be applied at several levels:
- Kubernetes Deployments - Increase replicas for LMS, Celery workers, or other services by changing the replica count in the manifests (or via HPA).
- Horizontal Pod Autoscaler (HPA) - Automatically scale the number of pods based on CPU, memory, or custom metrics.
- Cluster autoscaling - Node pool autoscaling (configured in Terraform/cloud provider) adds nodes when pods are unschedulable.
Instance-level Scaling¶
Tutor-generated manifests define Deployments for each service. To scale:
- Edit the manifest in the cluster repo (e.g. set
replicason the LMS or Celery deployment). - Commit and push; ArgoCD will sync the change, or trigger a manual sync.
Alternatively, use kubectl for a one-off change (will be overwritten on next ArgoCD sync):
kubectl scale deployment -n <instance-name> <deployment-name> --replicas=<n>
HPA¶
To add autoscaling based on metrics:
- Define an HPA resource in the instance manifests (or apply it separately), targeting the desired Deployment and metric (e.g. CPU utilization).
- Ensure a metrics pipeline (e.g. Prometheus + metrics-server) is available so the HPA controller can read metrics.
Details depend on your cluster’s metrics setup; see Cluster Monitoring.
The easiest way to generate the HPA configuration is to use tutor-contrib-pod-autoscaling. The plugin can be configured from the config.yaml of the instance and installed as:
PICASSO_EXTRA_COMMANDS:
- pip install tutor-contrib-pod-autoscaling
Related Documentation¶
- Instances Overview - Instance lifecycle
- Configuration - Where instance manifests live
- Cluster Monitoring - Metrics and Prometheus
- Instance Monitoring - Instance metrics and health
See Also¶
- Provisioning - Instance layout
- Infrastructure Overview - Cluster components
- Cluster Configuration - Terraform and node pools