Skip to main content
KEDA (Kubernetes Event-Driven Autoscaling) provides flexible, event-driven autoscaling for Fusion workloads as an alternative to the default Kubernetes Horizontal Pod Autoscaler (HPA). Traditional HPA-based autoscaling relies primarily on CPU and memory utilization. KEDA extends this by enabling you to scale workloads based on events, schedules, and business metrics, allowing you to align infrastructure capacity more closely with actual demand.

Autoscaling Fusion with KEDA

The course for Autoscaling Fusion with KEDA focuses on enabling and tuning event-driven, scheduled, and lag-based autoscaling for the api-gateway, query-pipeline, and fusion-indexing services. It covers cron, CPU, and Kafka consumer lag triggers, troubleshooting, and how Fusion 5.19 keeps indexing consistent while pods scale in and out.

Benefits

KEDA provides these advantages for Fusion workloads:
  • Event-driven autoscaling - Scale in response to external signals such as Prometheus metrics, queue depth, or pipeline execution load.
  • Scheduled scaling - Automatically scale workloads based on predictable traffic patterns, such as business hours or peak usage windows.
  • Scale-to-zero capability - Reduce infrastructure costs by scaling api-gateway and query-pipeline down to zero during off-hours or periods of inactivity.
  • Improved operational efficiency - Align infrastructure capacity with real business demand instead of relying solely on CPU or memory thresholds.
KEDA autoscaling over a 24-hour period

KEDA combines scheduled scaling (cron trigger) with reactive scaling (CPU trigger) to align infrastructure capacity with actual demand throughout the day.

Supported services

The following Fusion services support KEDA autoscaling:
  • api-gateway
  • query-pipeline
  • fusion-indexing
Solr pods use a standard HPA. For how that affects Solr collections, see Solr autoscaling limitations.
Don’t scale fusion-indexing to zero. It serves synchronous APIs, such as push indexing and parser testing, and no KEDA trigger can wake it in response to API traffic. In Fusion 5.19 and later, the Helm chart rejects a minReplicas or idleReplicaCount value of 0 for this service.

Before you begin

Before configuring KEDA for Fusion services, ensure you have:
  • KEDA version 2.18.3 or later installed in your Kubernetes cluster
  • Access to the Fusion Helm charts
  • Ability to provide a custom values file for your Fusion deployment
If KEDA isn’t already installed in your cluster, install it using Helm:
For more information, see the official KEDA documentation.

How KEDA autoscaling works

Fusion Helm charts support two mutually exclusive autoscaling mechanisms per workload:
  1. Kubernetes HPA (default) - Scales based on CPU and memory metrics.
  2. KEDA ScaledObject - Scales based on events, schedules, and custom metrics.
Only one autoscaling mechanism can be active per workload at a time. You can’t use both HPA and KEDA for the same service.
However, you can mix autoscaling approaches across different services. For example, use HPA for api-gateway and KEDA for query-pipeline.

Autoscaling parameters

Each Fusion service has three key autoscaling parameters:

Default behavior

When autoscaling.enabled is true and you don’t modify other settings, Fusion creates an HPA by default. This preserves backward compatibility with existing deployments.

Mutual exclusion

The Helm chart enforces these rules:
  • If autoscaling.enabled is false → No autoscaling (neither HPA nor KEDA)
  • If hpa.enabled is true and keda.enabled is false → HPA autoscaling
  • If hpa.enabled is false and keda.enabled is true → KEDA autoscaling
  • If both hpa.enabled and keda.enabled are true → No autoscaling (conflict resolution)
When KEDA creates a ScaledObject with certain trigger types, it may create its own HPA prefixed with keda-hpa-. This is expected behavior and indicates that KEDA is managing autoscaling correctly.

Enable KEDA

You can enable KEDA for the api-gateway, query-pipeline, or fusion-indexing services by editing the Fusion values file before a Fusion deployment or upgrade, as explained in the next section below.

Update the Fusion values file

The configuration for each Fusion service is the same, as shown below:

Deploy or upgrade Fusion

After preparing your custom values file (for example, fusion-values.yaml), deploy or upgrade Fusion:
Replace <RELEASE_NAME> and <FUSION_CHART_PATH> with your specific values.
To find your existing Fusion release name, run helm list -n <namespace>. The chart path can be a repository reference (for example, lucidworks/fusion) or a local path to the chart directory.

Verify the configuration

After deployment, verify that KEDA is active for the configured services.
Check for the ScaledObject:
The api-gateway ScaledObject should appear in the output.Verify that no conflicting HPA exists:
No HPA should exist for api-gateway, except those prefixed with keda-hpa- (which are managed by KEDA).
Check for the ScaledObject:
The query-pipeline ScaledObject should appear in the output.Verify that no conflicting HPA exists:
No HPA should exist for query-pipeline, except those prefixed with keda-hpa- (which are managed by KEDA).
Check for the ScaledObject:
The fusion-indexing ScaledObject should appear in the output.Verify that no conflicting HPA exists:
No HPA should exist for fusion-indexing, except those prefixed with keda-hpa- (which are managed by KEDA).
KEDA may create an HPA prefixed with keda-hpa- followed by your release name and service name. For example: keda-hpa-fusion-query-pipeline. This is expected when KEDA uses certain trigger types.

Custom configuration parameters

You can customize the scaling behavior, metadata, and the triggers KEDA monitors using the parameters in the table below. For the api-gateway, query-pipeline, or fusion-indexing services, replace [service-name] with the name of the service.
At least one trigger is required when KEDA is enabled. Without triggers, KEDA can’t determine when to scale your workload. For fusion-indexing, enabling the built-in kafka or prometheus trigger (see Triggers for fusion-indexing) satisfies this on its own; triggers is only required for api-gateway and query-pipeline, which have no built-in trigger.
This example demonstrates a custom KEDA configuration for query-pipeline with these components:
  • Cron trigger - Scales to 6 replicas during business hours (Monday-Friday, 7:00 AM - 6:00 PM Central Time).
  • CPU trigger - Scales up to 15 replicas when CPU utilization exceeds 60%.
For more information about available KEDA triggers, see the KEDA scalers documentation.

Triggers for fusion-indexing

This section applies to Fusion 5.19 and later.
fusion-indexing includes two built-in triggers that scale on Kafka consumer lag, so you don’t need to write your own. For details about how each trigger evaluates lag, see the KEDA Apache Kafka scaler and Prometheus scaler documentation.
Use the kafka trigger unless Prometheus already scrapes fusion-indexing. The kafka trigger depends only on the Kafka broker.

Scrape targets for the prometheus trigger

The prometheus trigger reads a metric that Prometheus must collect from fusion-indexing. The chart can create the scrape target for you. Enable the option that matches your Prometheus installation:
If Prometheus doesn’t collect kafka_consumer_fetch_manager_records_lag_max, KEDA reads the lag as 0 and never scales out. If prometheus.enabled is true, the chart fails to render unless keepRegex is empty, contains the full metric name, or keepRegexUnchecked is true.
This example scales fusion-indexing between 1 and 8 replicas using the kafka trigger:
Replace the placeholders with these values:
  • <RELEASE_NAME>: The Helm release name of your Fusion deployment.
  • <CONSUMER_GROUP> and <TOPIC>: The consumer group and topic of the indexing workload you want to scale on, typically your highest-volume datasource. Each trigger monitors one consumer group.
To list the consumer groups and see the topic each one reads, run these commands:
Index pipeline consumer groups follow the pattern index-pipeline--<PIPELINE_ID>--<TOPIC>. For example, index-pipeline--example_Products--fusion.connectors.datasource-products_S3_Load reads the topic fusion.connectors.datasource-products_S3_Load.

Troubleshooting

This section provides troubleshooting steps for some common issues with KEDA configuration.
  1. Verify that autoscaling.enabled is true.
  2. Verify that autoscaling.keda.enabled is true.
  3. Verify that autoscaling.hpa.enabled is false.
  4. Check that KEDA is installed: kubectl get pods -n keda.
  5. Review Helm deployment logs for errors.
  1. Check your configuration for conflicting settings.
  2. Ensure that both hpa.enabled and keda.enabled aren’t set to true.
  3. Delete the unwanted resource manually if necessary.
  1. Verify that triggers are configured correctly.
  2. Check KEDA operator logs: kubectl logs -n keda -l app=keda-operator
  3. Describe the ScaledObject to see its status: kubectl describe scaledobject <name> -n <namespace>
  4. Verify that the trigger source (metrics endpoint, queue, and so on) is accessible.
The Helm chart returns these errors because fusion-indexing doesn’t support scale-to-zero. Set fusion-indexing.autoscaling.keda.minReplicas to 1 or greater. Remove idleReplicaCount, or set it to a value from 1 up to, but not including, minReplicas.