Expose KEDA ScaledObject and HTTP scaling configuration options

Open
#4,044 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
go

Research direction

Start with pkg/keda/kafka_scaling.go and pkg/keda/deployer.go, then trace how scale.keda options from func.yaml are represented and passed into these KEDA configurations. Implement the proposed optional pollingInterval, cooldownPeriod, and HTTP targetValue fields first, and verify that configured values replace the current defaults without changing behavior when omitted.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Go
Stars
365
Forks
223
Avg merge
2d 3h
Merged PRs (30d)
25

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from knative/func

All issues in knative/func

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.