From eff339a165c1a0298b2d00dfcb100363057c7e65 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 10 Dec 2024 21:47:33 -0500 Subject: [PATCH] fix: correctly handle scale to zero with the Keda http addon There is a bug in the Keda project that caused Keda to incorrectly handle empty trigger lists. If self-managing the ScaledObject when using an HTTPScaledObject, an external-push trigger must be created. This change additionally updates the chart to fix any potential bugs in usage of keda. --- plugins/scheduler-k3s/functions.go | 8 ++++++++ plugins/scheduler-k3s/scheduler_k3s.go | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/scheduler-k3s/functions.go b/plugins/scheduler-k3s/functions.go index f93b910a4..f03b9159c 100644 --- a/plugins/scheduler-k3s/functions.go +++ b/plugins/scheduler-k3s/functions.go @@ -669,6 +669,14 @@ func getAutoscaling(input GetAutoscalingInput) (ProcessAutoscaling, error) { httpTrigger.Metadata["concurrency_target_value"] = "100" } + triggers = append(triggers, ProcessAutoscalingTrigger{ + Name: trigger.Name, + Type: "external-push", + Metadata: map[string]string{ + "httpScaledObject": fmt.Sprintf("%s-%s", input.AppName, input.ProcessType), + "scalerAddress": "keda-add-ons-http-external-scaler.keda:9090", + }, + }) continue } diff --git a/plugins/scheduler-k3s/scheduler_k3s.go b/plugins/scheduler-k3s/scheduler_k3s.go index b551cd574..c4e6aea34 100644 --- a/plugins/scheduler-k3s/scheduler_k3s.go +++ b/plugins/scheduler-k3s/scheduler_k3s.go @@ -120,7 +120,7 @@ var HelmCharts = []HelmChart{ Namespace: "keda", ReleaseName: "keda", RepoURL: "https://kedacore.github.io/charts", - Version: "2.13.1", + Version: "2.16.0", }, { ChartPath: "keda-add-ons-http",