Skip to content

Expose KEDA ScaledObject and HTTP scaling configuration options #4044

Description

@aliok

Problem

Several KEDA scaling configuration values are currently hardcoded and not configurable via func.yaml.

ScaledObject (Kafka trigger)

Hardcoded in pkg/keda/kafka_scaling.go:

  • cooldownPeriod: 300 (seconds) — how long before scaling down after triggers go idle
  • pollingInterval: not set, defaults to 30 seconds — how often KEDA checks metrics

Not exposed from KEDA's Kafka scaler:

  • offsetResetPolicy
  • allowIdleConsumers
  • excludePersistentLag
  • scaleToZeroOnInvalidOffset
  • limitToPartitionsWithLag

HTTPScaledObject (HTTP trigger)

Hardcoded in pkg/keda/deployer.go:

  • CooldownPeriod: 300
  • ScalingMetric.Rate.TargetValue: 100 (requests/sec)
  • ScalingMetric.Rate.Window: 1 minute
  • ScalingMetric.Rate.Granularity: 1 second

Proposed solution

Add optional fields to scale.keda in func.yaml for the common options:

deploy:
  options:
    scale:
      keda:
        pollingInterval: 15
        cooldownPeriod: 60
        triggers:
          - type: kafka
            lagThreshold: 5
          - type: http
            targetValue: 50

Start with pollingInterval, cooldownPeriod, and HTTP targetValue as the most impactful. The Kafka-specific options (allowIdleConsumers, etc.) can be added later as needed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions