Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Set concurrencyPolicy of CronJobs
Browse files Browse the repository at this point in the history
Allow to specify the concurrecnyPolicy for the backup and cleanup Jobs.
The default of Kubernetes is "Allow" but I think for this chart it makes sense
to set the default to "Forbid".
Bumped the major version because this is kind of an breaking change, even though
it probably breaks nothing.
  • Loading branch information
ekeih authored and morremeyer committed Aug 8, 2021
1 parent 849f44e commit 7d3c202
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/backup/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v2
name: backup
description: Chart to back up PVCs with restic and regularly clean up the snapshots.
type: application
version: 1.0.3
version: 2.0.0
2 changes: 2 additions & 0 deletions charts/backup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ The following table lists the configurable parameters of the chart and the defau
| backupJob.backup.image.repository | string | `"restic/restic"` | |
| backupJob.backup.image.tag | string | `"0.12.0"` | |
| backupJob.backup.resources | object | `{}` | resources for the backup container |
| backupJob.concurrencyPolicy | string | `"Forbid"` | concurrencyPolicy for the backup Jobs |
| backupJob.init | object | `{"image":{"pullPolicy":"IfNotPresent","repository":"restic/restic","tag":"0.12.0"},"resources":{}}` | Configuration for the repository init container |
| backupJob.init.resources | object | `{}` | resources for the init container |
| backupJob.nodeSelector | object | `{}` | |
Expand All @@ -50,6 +51,7 @@ The following table lists the configurable parameters of the chart and the defau
| cleanupJob.affinity | object | `{}` | |
| cleanupJob.args | list | `[]` | arguments for the cleanup. **Automatically generated, only set when necessary** |
| cleanupJob.command | string | `nil` | command for the cleanup. Defaults to '/usr/bin/restic' by the upstream container. |
| cleanupJob.concurrencyPolicy | string | `"Forbid"` | concurrencyPolicy for the cleanup Jobs |
| cleanupJob.enabled | bool | `true` | If backups shall be cleaned up after some time |
| cleanupJob.image.pullPolicy | string | `"IfNotPresent"` | |
| cleanupJob.image.repository | string | `"restic/restic"` | |
Expand Down
1 change: 1 addition & 0 deletions charts/backup/templates/cronjob-backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
{{- include "backup.labels" . | nindent 4 }}
spec:
schedule: {{ .Values.backupJob.schedule | quote }}
concurrencyPolicy: {{ .Values.backupJob.concurrencyPolicy }}
jobTemplate:
spec:
template:
Expand Down
1 change: 1 addition & 0 deletions charts/backup/templates/cronjob-cleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
{{- include "backup.labels" . | nindent 4 }}
spec:
schedule: {{ .Values.cleanupJob.schedule | quote }}
concurrencyPolicy: {{ .Values.cleanupJob.concurrencyPolicy }}
jobTemplate:
spec:
template:
Expand Down
6 changes: 6 additions & 0 deletions charts/backup/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ backupJob:
# -- when to run backups
schedule: "17 3 * * *"

# -- concurrencyPolicy for the backup Jobs
concurrencyPolicy: Forbid

# -- restartPolicy for the backup Jobs
restartPolicy: OnFailure

Expand Down Expand Up @@ -73,6 +76,9 @@ cleanupJob:
# -- number of yearly snapshots to keep
keepYearly: 2

# -- concurrencyPolicy for the cleanup Jobs
concurrencyPolicy: Forbid

# -- restartPolicy for the cleanup Jobs
restartPolicy: OnFailure

Expand Down

0 comments on commit 7d3c202

Please sign in to comment.