Skip to content

Commit

Permalink
feat: Enable user to suspend a cronjob (#452)
Browse files Browse the repository at this point in the history
Users want to be able to create a cronjob but leave it disabled. This pr enables them to suspend the cronjob and when the cronjob is suspended it reduces the `startingDeadlineSeconds` value to a super low value to ensure that jobs do not get queued up
  • Loading branch information
bbernays authored Nov 28, 2024
1 parent e74cc1b commit 940134d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/cloudquery/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ maintainers:
# 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: 35.0.0
version: 35.1.0

# -- This is the version number of the application being deployed.This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
3 changes: 2 additions & 1 deletion charts/cloudquery/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cloudquery

![Version: 35.0.0](https://img.shields.io/badge/Version-35.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 6.0](https://img.shields.io/badge/AppVersion-6.0-informational?style=flat-square)
![Version: 35.1.0](https://img.shields.io/badge/Version-35.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 6.0](https://img.shields.io/badge/AppVersion-6.0-informational?style=flat-square)

Open source high performance data integration platform designed for security and infrastructure teams.

Expand Down Expand Up @@ -37,6 +37,7 @@ Kubernetes: `^1.8.0-0`
| cronJobLimit | int | `3` | Number of successful cronjobs to retain. |
| cronJobPodAnnotations | object | `{}` | Optional. CronJob Pod annotations. |
| cronJobPodLabels | object | `{}` | Optional. CronJob Pod labels. |
| cronJobSuspend | bool | `false` | Optional. Disable the execution of the Cronjob |
| deploymentAnnotations | object | `{}` | Optional. Admin Deployment annotations. |
| envRenderSecret | object | `{}` | Sensible environment variables that will be rendered as new secret object This can be useful for auth tokens, etc Make sure not to commit sensitive values to git!! Better use AWS Secret manager (or any other) |
| fullnameOverride | string | `""` | |
Expand Down
4 changes: 4 additions & 0 deletions charts/cloudquery/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ metadata:
{{- include "cloudquery.annotations" . }}
spec:
schedule: "{{ .Values.schedule }}"
suspend: {{ .Values.cronJobSuspend }}
{{- if .Values.cronJobSuspend }}
startingDeadlineSeconds: 5
{{- end }}
successfulJobsHistoryLimit: {{ .Values.cronJobLimit }}
failedJobsHistoryLimit: {{ .Values.cronJobFailedJobsLimit }}
concurrencyPolicy: Forbid
Expand Down
3 changes: 3 additions & 0 deletions charts/cloudquery/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,6 @@ cronJobPodLabels: {}
# -- Optional. Additional CLI arguments to pass to the scheduled sync job (e.g. setting log format)
# More information at: https://www.cloudquery.io/docs/reference/cli/cloudquery
cronJobAdditionalArgs: []

# -- Optional. Disable the execution of the Cronjob
cronJobSuspend: false

0 comments on commit 940134d

Please sign in to comment.