Autoscaler Configuration
For each new dev environment, CodeCanvas creates a worker pod. It is crucial that the dev environment cluster has enough resources to start these pods. You can achieve this either with a fixed pool of nodes or by using a node pool with an autoscaler. The benefits of using the autoscaler are:
Automatic scaling: The autoscaler can add or remove nodes based on the current load.
Resource efficiency: During low loads, the autoscaler scales down to a minimum size saving costs.
Availability: The autoscaler ensures that there are always enough resources to start new dev environments.
Recommendations
Over-provisioning
Starting a new node can take time, so it is important to have some level of over-provisioning to handle sudden spikes in demand. CodeCanvas uses Persistent Volume Claims (PVC) for storing user data, which are bound to Availability Zones (AZ). Therefore, over-provisioning should be implemented in each AZ to ensure that there are enough resources to start new dev environments. Learn more
Karpenter autoscaler
We recommend using Karpenter – an open-source autoscaler for Kubernetes. When configuring Karpenter, ensure that each AZ has enough capacity to accommodate at least two additional "large" dev environments. A "large" dev environment refers to the instance type with the highest resource configuration in your CodeCanvas installation.