Unverified Commit 5fb994f0 authored by alespour's avatar alespour Committed by GitHub

[influxdb] fix backup job (#462)

* fix optional parameter handling * add backup job node selector support * bump version * Fix indenting Co-authored-by: 's avatarPavel Závora <pavel.zavora@bonitoo.io> * Fixed indenting more
parent 3219dd54
apiVersion: v1
name: influxdb
version: 4.11.0
version: 4.12.0
appVersion: 1.8.10
description: Scalable datastore for metrics, events, and real-time analytics.
keywords:
......
......@@ -13,12 +13,15 @@ set -e
# Sanity check to avoid removing all backups.
[[ "$DAYS_TO_RETAIN" -lt 1 ]] && DAYS_TO_RETAIN=1
# Prepare endpoint-url argument
[[ -z "$S3_ENDPOINT" ]] && endpoint_arg="" || endpoint_arg="--endpoint-url ${S3_ENDPOINT}"
function get_records {
before_date="$1"
aws s3api list-objects \
--bucket ${S3_BUCKET} \
--endpoint-url ${S3_ENDPOINT} \
${endpoint_arg} \
--query "Contents[?LastModified<='${before_date}'][].{Key: Key}"
}
......@@ -56,7 +59,7 @@ function remove_old_backups {
for path in "${del_paths[@]::${num_to_delete}}"; do
aws s3 rm "s3://${S3_BUCKET}/${path}" \
--endpoint-url "${S3_ENDPOINT}"
${endpoint_arg}
done
}
......
......@@ -28,6 +28,10 @@ spec:
{{- include "influxdb.selectorLabels" . | nindent 12 }}
spec:
restartPolicy: OnFailure
{{- with .Values.backup.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 12 }}
{{- end }}
volumes:
- name: backup
{{- if .Values.backup.persistence.enabled }}
......
......@@ -262,20 +262,21 @@ backup:
startingDeadlineSeconds: ""
annotations: {}
podAnnotations: {}
nodeSelector: {}
## Google Cloud Storage
# gcs:
# serviceAccountSecret: influxdb-backup-key
# serviceAccountSecretKey: key.json
# destination: gs://bucket/influxdb
# serviceAccountSecret: influxdb-backup-key
# serviceAccountSecretKey: key.json
# destination: gs://bucket/influxdb
## Azure
## Secret is expected to have connection string stored in `connection-string` field
## Existing container will be used or private one withing storage account will be created.
# azure:
# storageAccountSecret: influxdb-backup-azure-key
# destination_container: influxdb-container
# destination_path: ""
# storageAccountSecret: influxdb-backup-azure-key
# destination_container: influxdb-container
# destination_path: ""
## Amazon S3 or compatible
## Secret is expected to have AWS (or compatible) credentials stored in `credentials` field.
......@@ -283,10 +284,10 @@ backup:
## for the credentials format.
## The bucket should already exist.
# s3:
# credentialsSecret: aws-credentials-secret
# destination: s3://bucket/path
# ## Optional. Specify if you're using an alternate S3 endpoint.
# # endpointUrl: ""
# credentialsSecret: aws-credentials-secret
# destination: s3://bucket/path
## Optional. Specify if you're using an alternate S3 endpoint.
# endpointUrl: ""
backupRetention:
enabled: false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment