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

Add envSourceContainerName to KEDA ScaledObject #44963

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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: 1 addition & 0 deletions chart/templates/triggerer/triggerer-kedaautoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ spec:
scaleTargetRef:
kind: {{ ternary "StatefulSet" "Deployment" .Values.triggerer.persistence.enabled }}
name: {{ .Release.Name }}-triggerer
envSourceContainerName: {{ include "airflow.fullname" . }}-worker
pollingInterval: {{ .Values.triggerer.keda.pollingInterval }}
cooldownPeriod: {{ .Values.triggerer.keda.cooldownPeriod }}
minReplicaCount: {{ .Values.triggerer.keda.minReplicaCount }}
Expand Down
1 change: 1 addition & 0 deletions chart/templates/workers/worker-kedaautoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ spec:
scaleTargetRef:
kind: {{ ternary "StatefulSet" "Deployment" .Values.workers.persistence.enabled }}
name: {{ include "airflow.fullname" . }}-worker
envSourceContainerName: {{ include "airflow.fullname" . }}-worker
pollingInterval: {{ .Values.workers.keda.pollingInterval }}
cooldownPeriod: {{ .Values.workers.keda.cooldownPeriod }}
minReplicaCount: {{ .Values.workers.keda.minReplicaCount }}
Expand Down
17 changes: 17 additions & 0 deletions helm_tests/other/test_keda.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,23 @@ def test_keda_enabled(self, executor, is_created):
else:
assert docs == []

@pytest.mark.parametrize(
"executor, is_created",
[
("CeleryExecutor", True),
("CeleryKubernetesExecutor", True),
],
)
def test_include_event_source_container_name_in_scaled_object(self, executor, is_created):
docs = render_chart(
values={
"workers": {"keda": {"enabled": True}, "persistence": {"enabled": False}},
"executor": executor,
},
show_only=["templates/workers/worker-kedaautoscaler.yaml"],
)
assert jmespath.search("spec.scaleTargetRef.envSourceContainerName", docs[0]) == "release-name-worker"

@pytest.mark.parametrize("executor", ["CeleryExecutor", "CeleryKubernetesExecutor"])
def test_keda_advanced(self, executor):
"""Verify keda advanced config."""
Expand Down