Skip to content

Add node selector support for cleanup job - #101

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

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

Conversation

@wangxiaoyou1993

@wangxiaoyou1993 wangxiaoyou1993 commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Add a cleanup-job-specific nodeSelector so operators can schedule the cleanup CronJob on labeled nodes independently from the Mage application pods.

The new value is optional and the chart continues to omit spec.jobTemplate.spec.template.spec.nodeSelector when it is unset or empty. Existing installations and values files therefore render the cleanup job as they did before.

Why

The chart already exposes a top-level nodeSelector for Mage application pods, but the cleanup CronJob did not render that value or provide its own scheduling configuration. In clusters with dedicated maintenance node pools or node-placement policies, operators could not target the cleanup workload without patching the rendered resource.

Configuration

cleanupJob:
  enabled: true
  schedule_cron: "0 * * * *"
  nodeSelector:
    workload: maintenance

cleanupJob.nodeSelector applies only to the cleanup CronJob. The existing top-level nodeSelector continues to control Mage application pods.

Backward compatibility

  • cleanupJob.nodeSelector defaults to an empty map.
  • Empty or omitted values do not render a nodeSelector field.
  • Existing cleanup-job and top-level scheduling values are unchanged.
  • The chart receives a patch version bump from 0.2.17 to 0.2.18.

Implementation

  • Render the configured map at spec.jobTemplate.spec.template.spec.nodeSelector.
  • Document the new value in values.yaml and the repository README.
  • Add focused tests for the disabled job, the default selector omission, and a selector with multiple labels.

Testing

  • helm lint charts/mageai
  • helm unittest charts/mageai — 27 tests passed
  • Rendered the cleanup CronJob with multiple selector labels and verified their placement in the pod spec

@wangxiaoyou1993
wangxiaoyou1993 merged commit 8546d00 into master Nov 9, 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