Skip to main content
Auto-Scaling automatically adjusts the available resources of your deployments, and eliminates the need for scripts or consulting services to make scaling decisions. It currently supports scaling for Pulsar nodes only and works on a rolling basis, meaning the process doesn’t incur any downtime. You can specify a range of minimum and maximum Pulsar nodes that your Pulsar cluster can automatically scale to, our Cloud scaler will monitor the CPU workload of Broker nodes and adjust their nodes based on the scaling rule.

Overview of Auto-Scaling

One of the significant challenges faced by organizations dealing with real-time data is ensuring that the underlying infrastructure can handle varying workloads. Traditional scaling methods often involve manual intervention, leading to inefficiency, and increased operational costs. Private Cloud Auto-Scaling addresses these challenges by providing an intelligent, automated solution. The Power of Private Cloud Auto-Scaling:
  • Dynamic Resource Allocation: Private Cloud Auto-Scaling dynamically adjusts resources based on the incoming workload. Whether it’s handling a sudden spike in traffic or scaling down during periods of low activity, Pulsar ensures optimal resource utilization, leading to cost savings and improved performance.
  • Efficient Load Balancing: Auto-Scaling in Pulsar ensures that the message processing load is evenly distributed across brokers. This prevents any single broker from becoming a bottleneck, allowing the system to maintain high throughput and low latency even under heavy loads.
  • Cost-Effective Scaling: Traditional scaling methods often result in over-provisioning to handle peak loads, leading to unnecessary costs. Private Cloud Auto-Scaling optimizes resource allocation, ensuring that organizations pay only for the resources they need, making it a cost-effective solution for real-time data processing.
After enabling the Auto-Scaling, the scaling controller will track the average metrics usage of the Pulsar nodes and adjusts the nodes to keep at the target metrics usage level. If the average metrics usage for nodes is over the target, scaling controller will scale out to bring more nodes and if the average metrics for the nodes is less than the target, scaling controller will downscale nodes to save resources.

Auto-Scaling with resource metrics

Prerequisites

Private Cloud Auto-Scaling by default uses resource metrics for Pod scaling which requires the Kubernetes Metrics Server to provide metrics.
  1. Deploy the Metrics Server with the following command:
  1. Verify that the metrics-server deployment is running

Enable Auto-Scaling with resource metrics

Private Cloud Auto-Scaling has default scaling policy basd on cpu Utilization as
After installing themetrics-server, you can easily enable the Auto-Scaling with spec.autoScalingPolicy field on PulsarBroker CR and PulsarProxy CR:

Auto-Scaling with custom metrics

Private Cloud Auto-Scaling supports configuring scaling policy based on custom metrics and multiple metrics to cover more complex scenario.

Prerequisites

To use the custom metrics Auto-Scaling, we need to install the Prometheus and Prometheus Adapter to provide metrics.
  1. Create Kubernetes namespace for Promtheus and Prometheus Adapter:
  1. Add prometheus-community Helm repo
  1. Install the Prometheus chart
  1. Preapre a values config sample-config.yaml for Prometheus Adapter chart
  1. Install the Prometheus Adapter chart

Enable Auto-Scaling with custom metrics

After installing the Promtheus and Prometheus Adapter, you can configure to use custom metrics at the spec.autoScalingPolicy.metrics:
This configuration will leverage cpu_usage, network_in_rate_kb and network_out_rate_kb for Auto-Scaling. To customize the scaling policy for Auto-Scaling, you can configure at the spec.autoScalingPolicy.behavior::
  • [1] scaleDown: Define the behavior while scaling down.
  • [2] scaleUp: Define the behavior while scaling up.
  • [3] stabilizationWindowSeconds: Stabilization window is used to restrict the flapping of replica count when the metrics used for scaling keep fluctuating.
  • [4] policies: Define the scaling policy, you can limit the scaling number or percent in the periodSeconds.