Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added retention time value for helm chart #66

Merged
merged 7 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion charts/dbp-moodle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ The Chart can be deployed without any modification but it is advised to set own
| backup-cronjob.serviceAccount.create | bool | `false` | |
| backup-cronjob.serviceAccount.name | string | `"moodle-backup-job"` | |
| backup-cronjob.tolerations | list | `[]` | |
| dbpMoodle.backup | object | `{"cluster_name":"","enabled":false,"endpoint":"","gpg_key_names":"","gpgkeys":{"existingSecret":"","gpgkey.dbpinfra.pub.asc":"","gpgkey.dbpinfra.sec.asc":""},"rules":[{"apiGroups":["apps"],"resources":["deployments"],"verbs":["get","patch","list","watch"]},{"apiGroups":["batch"],"resources":["cronjobs","jobs"],"verbs":["get","patch"]}],"s3_bucket_name":"","secrets":{"existingSecret":"","s3_access_key":"","s3_access_secret":"","s3_endpoint_url":""}}` | Backup configuration. Set enabled=true to enable the backup-cronjob. Also set s3 location credentials |
| dbpMoodle.backup | object | `{"cluster_name":"","enabled":false,"endpoint":"","gpg_key_names":"","gpgkeys":{"existingSecret":"","gpgkey.dbpinfra.pub.asc":"","gpgkey.dbpinfra.sec.asc":""},"max_full_backup_age":"1W","retention_time":"6M","rules":[{"apiGroups":["apps"],"resources":["deployments"],"verbs":["get","patch","list","watch"]},{"apiGroups":["batch"],"resources":["cronjobs","jobs"],"verbs":["get","patch"]}],"s3_bucket_name":"","secrets":{"existingSecret":"","s3_access_key":"","s3_access_secret":"","s3_endpoint_url":""}}` | Backup configuration. Set enabled=true to enable the backup-cronjob. Also set s3 location credentials |
| dbpMoodle.backup.gpgkeys.existingSecret | string | `""` | Existing secret for gpg keys |
| dbpMoodle.backup.max_full_backup_age | string | `"1W"` | Defines the maximum age of a full backup before a new full backup is created. The backups in between are incremental |
| dbpMoodle.backup.retention_time | string | `"6M"` | Defines the maximum age of a backup before it is deleted |
| dbpMoodle.backup.secrets | object | `{"existingSecret":"","s3_access_key":"","s3_access_secret":"","s3_endpoint_url":""}` | Either provide an existing secret, or set each secret value here. If both are set the existingSecret is used |
| dbpMoodle.backup.secrets.existingSecret | string | `""` | Existing secret for s3 endpoint |
| dbpMoodle.debug | bool | `false` | Moodle debugging is not safe for production |
Expand Down
8 changes: 8 additions & 0 deletions charts/dbp-moodle/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
{{- default "moodle" .Values.dbpMoodle.secrets.etherpad_api_key }}
{{- end -}}

{{- define "dbpMoodle.backup.retention_time" -}}
{{- default "6M" .Values.dbpMoodle.backup.retention_time }}
{{- end -}}

{{- define "dbpMoodle.backup.max_full_backup_age" -}}
{{- default "1W" .Values.dbpMoodle.backup.max_full_backup_age }}
{{- end -}}

{{- define "dbpMoodle.pluginConfigMap.content" -}}
kaltura:kaltura:: {{- .Values.global.moodlePlugins.kaltura.enabled }}{{"\n"}}
wunderbyte_table:local_wunderbyte_table:local/wunderbyte_table: {{- .Values.global.moodlePlugins.booking.enabled}}{{"\n"}}
Expand Down
4 changes: 2 additions & 2 deletions charts/dbp-moodle/templates/configmaps/duply-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ data:
GPG="/usr/bin/gpg"
TARGET="boto3+s3://{{ .Values.dbpMoodle.backup.s3_bucket_name }}/{{ .Values.dbpMoodle.backup.cluster_name }}/{{ .Release.Namespace }}/"
SOURCE='/'
MAX_AGE=6M
MAX_FULLBKP_AGE=1W
MAX_AGE={{ include "dbpMoodle.backup.retention_time" . }}
MAX_FULLBKP_AGE={{ include "dbpMoodle.backup.max_full_backup_age" . }}
DUPL_PARAMS="$DUPL_PARAMS --full-if-older-than $MAX_FULLBKP_AGE --allow-source-mismatch --s3-endpoint-url {{ .Values.dbpMoodle.backup.endpoint }}"
exclude: |-
+ /tmp/backup
Expand Down
4 changes: 4 additions & 0 deletions charts/dbp-moodle/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ dbpMoodle:
# -- Backup configuration. Set enabled=true to enable the backup-cronjob. Also set s3 location credentials
backup:
enabled: false
# -- Defines the maximum age of a backup before it is deleted
retention_time: "6M"
# -- Defines the maximum age of a full backup before a new full backup is created. The backups in between are incremental
max_full_backup_age: "1W"
gpg_key_names: ""
gpgkeys:
gpgkey.dbpinfra.pub.asc: ""
Expand Down