Helm: Scope KEDA_DB_CONN to worker and triggerer pods#70213
Open
pranayyelugam wants to merge 3 commits into
Open
Helm: Scope KEDA_DB_CONN to worker and triggerer pods#70213pranayyelugam wants to merge 3 commits into
pranayyelugam wants to merge 3 commits into
Conversation
pranayyelugam
requested review from
Miretpl,
bugraoz93,
hussein-awala,
jedcunningham and
jscheffl
as code owners
July 22, 2026 06:02
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
pranayyelugam
force-pushed
the
fix/keda-db-conn-scope
branch
from
July 22, 2026 06:05
8f31203 to
5c55c6f
Compare
Miretpl
requested changes
Jul 22, 2026
Miretpl
requested changes
Jul 24, 2026
Comment on lines
+153
to
+157
| {{- $triggererKedaEnabled := and .Values.triggerer.enabled .Values.triggerer.keda.enabled }} | ||
| {{- $workersKedaNeedsDbConn := and .Values.workers.celery.keda.enabled (or (eq .Values.data.metadataConnection.protocol "mysql") (and .Values.pgbouncer.enabled (not .Values.workers.celery.keda.usePgbouncer))) }} | ||
| {{- $triggererKedaNeedsDbConn := and $triggererKedaEnabled (or (eq .Values.data.metadataConnection.protocol "mysql") (and .Values.pgbouncer.enabled (not .Values.triggerer.keda.usePgbouncer))) }} | ||
| {{- $component := .Component | default "" }} | ||
| {{- if or (and (eq $component "worker") $workersKedaNeedsDbConn) (and (eq $component "triggerer") $triggererKedaNeedsDbConn) }} |
Contributor
There was a problem hiding this comment.
I think that we could simplify this by:
- Moving checking if keda is enabled for a particular component to the template files
- Passing as an additional argument here the value of
.Values.triggerer.keda.usePgBounceror.Values.workers.celery.keda.usePgBouncer
and the rest of the logic is common.
| return jmespath.search("spec.template.spec.containers[].env[].name", doc) or [] | ||
|
|
||
| def test_worker_keda_db_conn_not_leaked_to_other_components(self): | ||
| """Worker KEDA_DB_CONN should render on the worker only, not on unrelated components.""" |
Contributor
There was a problem hiding this comment.
Suggested change
| """Worker KEDA_DB_CONN should render on the worker only, not on unrelated components.""" |
Name of the test case is descriptive enough that we don't need additional comment I think.
| assert "KEDA_DB_CONN" not in self._env_names(triggerer) | ||
|
|
||
| def test_triggerer_keda_db_conn_not_leaked_to_other_components(self): | ||
| """Triggerer KEDA_DB_CONN should render on the triggerer only, not on the worker or others.""" |
Contributor
There was a problem hiding this comment.
Suggested change
| """Triggerer KEDA_DB_CONN should render on the triggerer only, not on the worker or others.""" |
Same as above comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The KEDA database connection was emitted from the shared environment helper included by every component, so enabling KEDA autoscaling on workers (or the triggerer) injected the KEDA_DB_CONN secret into the scheduler, api-server, dag-processor, flower and the migration and user-creation jobs, none of which use it. Only the worker and triggerer scalers resolve this variable, so restricting to those pods.
Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.