From d1be93e7b34d3298ef5f29affaa833c7feaaa862 Mon Sep 17 00:00:00 2001 From: Rohil Surana Date: Wed, 1 Jul 2026 02:26:49 +0530 Subject: [PATCH] feat: add resource requests/limits support for cronjobs --- stable/app/Chart.yaml | 2 +- stable/app/README.md | 2 ++ stable/app/templates/cron.yaml | 2 ++ stable/app/values.yaml | 5 +++++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/stable/app/Chart.yaml b/stable/app/Chart.yaml index a2fef18e..b87a37ce 100644 --- a/stable/app/Chart.yaml +++ b/stable/app/Chart.yaml @@ -15,4 +15,4 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.10.2 +version: 0.10.3 diff --git a/stable/app/README.md b/stable/app/README.md index aa74a443..63308e32 100644 --- a/stable/app/README.md +++ b/stable/app/README.md @@ -59,6 +59,8 @@ The following table lists the configurable parameters of the Siren chart and the | cron.jobs[0].args | string | `""` | | | cron.jobs[0].schedule | string | `"0 0 * * *"` | | | cron.jobs[0].restartPolicy | string | `Never` | | +| cron.jobs[0].resources | object | `{}` | Per-job resource requests/limits; overrides `cron.resources` when set | +| cron.resources | object | `{}` | Default resource requests/limits applied to every cron job container | | fullnameOverride | string | `""` | | | image.pullPolicy | string | `"IfNotPresent"` | Specify the docker image path/repository. | | image.repository | string | `nil` | | diff --git a/stable/app/templates/cron.yaml b/stable/app/templates/cron.yaml index be24e536..4b80970d 100644 --- a/stable/app/templates/cron.yaml +++ b/stable/app/templates/cron.yaml @@ -31,6 +31,8 @@ spec: - name: {{ $job.name }} image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag | default $.Chart.AppVersion }}" imagePullPolicy: {{ $.Values.image.pullPolicy }} + resources: + {{- toYaml (default $.Values.cron.resources $job.resources) | nindent 16 }} command: {{- toYaml $job.command | nindent 16 }} args: diff --git a/stable/app/values.yaml b/stable/app/values.yaml index 49292b17..b5c1ccb6 100644 --- a/stable/app/values.yaml +++ b/stable/app/values.yaml @@ -95,6 +95,9 @@ affinity: {} cron: enabled: false annotations: {} + # -- Default resource requests/limits applied to every cron job container. + # -- Override per job with `cron.jobs[].resources`. + resources: {} # -- We would recommend to use a small unique job name since it would be used to identify the cronjob in k8s # -- and job name would be truncated to 29 characters in the cron job template. jobs: @@ -102,6 +105,8 @@ cron: schedule: "0 0 * * *" restartPolicy: Never backoffLimit: 4 + # -- Per-job resource requests/limits; overrides `cron.resources` when set. + resources: {} command: - app args: