Skip to content

feat: add resource requests/limits support for cronjobs#140

Merged
rohilsurana merged 1 commit into
raystack:mainfrom
rohilsurana:feat/cronjob-resources
Jul 1, 2026
Merged

feat: add resource requests/limits support for cronjobs#140
rohilsurana merged 1 commit into
raystack:mainfrom
rohilsurana:feat/cronjob-resources

Conversation

@rohilsurana

Copy link
Copy Markdown
Member

Motivation

The cron job container template doesn't expose resources, so cron jobs always run with no requests/limits — there's no way to bound their memory/CPU. This adds that support.

Changes

  • Each cron job can define its own resources via cron.jobs[].resources.
  • A chart-level default cron.resources is applied to every cron job and can be overridden per job.
  • Precedence: cron.jobs[].resourcescron.resources{}.
cron:
  resources:                 # default for all cron jobs
    requests:
      memory: 1Gi
  jobs:
    - name: light
      # inherits cron.resources
    - name: heavy
      resources:             # overrides the default for this job
        limits:
          memory: 6Gi
        requests:
          memory: 2Gi

Backward compatibility

Defaults to {}, which renders resources: {} — equivalent to the previous no-resources behavior. No change for existing users.

Verification

helm lint passes and helm template renders correctly:

  • a job with no resources inherits cron.resources,
  • a job with resources overrides the default,
  • with neither set it renders resources: {}.

Chart version bumped 0.10.20.10.3; values and README updated.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: db4106ce-f265-4acf-8524-7e0d44ff6041

📥 Commits

Reviewing files that changed from the base of the PR and between ac333a9 and d1be93e.

📒 Files selected for processing (4)
  • stable/app/Chart.yaml
  • stable/app/README.md
  • stable/app/templates/cron.yaml
  • stable/app/values.yaml

📝 Walkthrough

Walkthrough

This PR adds configurable resource requests/limits for cron job containers in a Helm chart. A default cron.resources value and a per-job resources override field were added to values.yaml. The CronJob template now renders a resources block, defaulting to cron.resources and overriding with the per-job value when specified. The README was updated to document both new parameters, and the chart version was bumped from 0.10.2 to 0.10.3.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change by mentioning cronjob resource requests/limits support.
Description check ✅ Passed The description matches the changeset and explains the cronjob resource defaults, overrides, and compatibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rohilsurana rohilsurana merged commit 5b3a0f6 into raystack:main Jul 1, 2026
2 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