Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.11] Remove activationLagThreshold to fix 0->1 scaling #3482

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion control-plane/pkg/autoscaler/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ func defaultConfig() *AutoscalerConfig {
AutoscalingPollingIntervalAnnotation: DefaultPollingInterval,
AutoscalingCooldownPeriodAnnotation: DefaultCooldownPeriod,
AutoscalingLagThreshold: DefaultLagThreshold,
AutoscalingActivationLagThreshold: DefaultActivationLagThreshold,
},
}
}
Expand Down
16 changes: 5 additions & 11 deletions control-plane/pkg/autoscaler/keda/keda.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,18 @@ func GenerateScaleTriggers(cg *kafkainternals.ConsumerGroup, triggerAuthenticati
return nil, err
}

activationLagThreshold, err := GetInt32ValueFromMap(cg.Annotations, autoscaler.AutoscalingActivationLagThreshold, aconfig.AutoscalerDefaults[autoscaler.AutoscalingActivationLagThreshold])
if err != nil {
return nil, err
}

allowIdleConsumers := "false"
if cg.Status.Placements != nil {
allowIdleConsumers = "true"
}

for _, topic := range cg.Spec.Template.Spec.Topics {
triggerMetadata := map[string]string{
"bootstrapServers": bootstrapServers,
"consumerGroup": consumerGroup,
"topic": topic,
"lagThreshold": strconv.Itoa(int(*lagThreshold)),
"activationLagThreshold": strconv.Itoa(int(*activationLagThreshold)),
"allowIdleConsumers": allowIdleConsumers,
"bootstrapServers": bootstrapServers,
"consumerGroup": consumerGroup,
"topic": topic,
"lagThreshold": strconv.Itoa(int(*lagThreshold)),
"allowIdleConsumers": allowIdleConsumers,
}

trigger := kedav1alpha1.ScaleTriggers{
Expand Down
Loading