mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
[stable/influxdb] Add support for Azure to backup job (#16722)
Signed-off-by: Tomasz Glowka <glowka.tom@gmail.com>
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
08fc376647
commit
c01d303e15
@@ -1,6 +1,6 @@
|
||||
apiVersion: v1
|
||||
name: influxdb
|
||||
version: 1.3.4
|
||||
version: 1.4.0
|
||||
appVersion: 1.7.6
|
||||
description: Scalable datastore for metrics, events, and real-time analytics.
|
||||
keywords:
|
||||
|
||||
@@ -25,12 +25,14 @@ spec:
|
||||
volumes:
|
||||
- name: backups
|
||||
emptyDir: {}
|
||||
{{- if and .Values.backup.gcs }}
|
||||
- name: google-cloud-key
|
||||
secret:
|
||||
secretName: {{ .Values.backup.gcs.serviceAccountSecret | quote }}
|
||||
{{- end }}
|
||||
initContainers:
|
||||
- name: influxdb-backup
|
||||
image: "{{ .Values.image.repo }}:{{ .Values.image.tag }}"
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
volumeMounts:
|
||||
- name: backups
|
||||
mountPath: /backups
|
||||
@@ -41,6 +43,7 @@ spec:
|
||||
- |
|
||||
influxd backup -host {{ template "influxdb.fullname" . }}.{{ .Release.Namespace }}.svc:{{ .Values.config.rpc.bind_address }} -portable /backups/backup_$(date +%Y%m%d_%H%M%S)
|
||||
containers:
|
||||
{{- if .Values.backup.gcs}}
|
||||
- name: gsutil-cp
|
||||
image: google/cloud-sdk:alpine
|
||||
command:
|
||||
@@ -59,7 +62,34 @@ spec:
|
||||
- name: SRC_URL
|
||||
value: /backups
|
||||
- name: DST_URL
|
||||
value: {{ .Values.backup.destination}}
|
||||
value: {{ .Values.gcs.backup.destination}}
|
||||
- name: KEY_FILE
|
||||
value: /var/secrets/google/key.json
|
||||
{{- end }}
|
||||
{{- if .Values.backup.azure }}
|
||||
- name: azure-cli
|
||||
image: microsoft/azure-cli
|
||||
command:
|
||||
- /bin/sh
|
||||
args:
|
||||
- '-c'
|
||||
- |
|
||||
az storage container create --name "$DST_CONTAINER"
|
||||
az storage blob upload-batch --destination "$DST_CONTAINER" --destination-path "$DST_PATH" --source "$SRC_URL"
|
||||
volumeMounts:
|
||||
- name: backups
|
||||
mountPath: /backups
|
||||
env:
|
||||
- name: SRC_URL
|
||||
value: /backups
|
||||
- name: DST_CONTAINER
|
||||
value: {{ .Values.backup.azure.destination_container }}
|
||||
- name: DST_PATH
|
||||
value: {{ .Values.backup.azure.destination_path }}
|
||||
- name: AZURE_STORAGE_CONNECTION_STRING
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.backup.azure.storageAccountSecret }}
|
||||
key: connection-string
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -280,7 +280,17 @@ backup:
|
||||
enabled: false
|
||||
schedule: "0 0 * * *"
|
||||
annotations: {}
|
||||
destination: gs://bucket/influxdb
|
||||
# Google Cloud Storage
|
||||
gcs:
|
||||
serviceAccountSecret: influxdb-backup-key
|
||||
|
||||
## Google Cloud Storage
|
||||
## Secret is expected to have key stored in `key.json` field
|
||||
# gcs:
|
||||
# serviceAccountSecret: influxdb-backup-key
|
||||
# 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: ""
|
||||
|
||||
Reference in New Issue
Block a user