Skip to content

Default cleanup job to application node selector - #102

Merged
wangxiaoyou1993 merged 1 commit into
masterfrom
codex/cleanup-job-node-selector-default
Nov 10, 2026
Merged

wangxiaoyou1993 merged 1 commit into
masterfrom
codex/cleanup-job-node-selector-default

Conversation

@wangxiaoyou1993

Copy link
Copy Markdown
Member

Summary

Make the cleanup CronJob inherit the top-level nodeSelector used by the Mage application pods unless a non-empty cleanupJob.nodeSelector override is configured.

Why

PR #101 added an independent cleanup-job selector. For the common case, operators expect the cleanup workload to follow the same node-placement policy as the deployment without repeating the label map in two values.

Behavior

Precedence is:

  1. A non-empty cleanupJob.nodeSelector applies only to the cleanup CronJob.
  2. Otherwise, the cleanup CronJob uses the top-level nodeSelector.
  3. If both selectors are empty, the chart omits the field.
nodeSelector:
  workload: application

cleanupJob:
  enabled: true
  # Optional override:
  nodeSelector:
    workload: maintenance

This intentionally changes cleanup-job placement for installations that already configure a top-level nodeSelector: the cleanup CronJob will now use that selector by default.

Implementation

  • Add top-level selector fallback in the cleanup CronJob template.
  • Document inheritance and override precedence.
  • Add tests for omission, inheritance, explicit configuration, and override precedence.
  • Bump the chart patch version from 0.2.18 to 0.2.19.

Testing

  • helm lint charts/mageai
  • helm unittest charts/mageai — 29 tests passed
  • Manually rendered inherited and overridden multi-label selectors at the CronJob pod-spec path

@wangxiaoyou1993
wangxiaoyou1993 merged commit 82d44d5 into master Nov 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants