Skip to content

Commit

Permalink
Update kubedb-kubestash-catalog chart
Browse files Browse the repository at this point in the history
Signed-off-by: hmsayem <[email protected]>
  • Loading branch information
hmsayem committed Jan 23, 2024
1 parent d8e29ca commit 9690c81
Show file tree
Hide file tree
Showing 5 changed files with 200 additions and 0 deletions.
122 changes: 122 additions & 0 deletions charts/kubedb-kubestash-catalog/templates/mariadb/mariadb-addon.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{{ $featureGates := .Values.featureGates }}
{{- if .Values.global }}
{{ $featureGates = mergeOverwrite dict .Values.featureGates .Values.global.featureGates }}
{{- end }}

{{ if $featureGates.MariaDB }}
apiVersion: addons.kubestash.com/v1alpha1
kind: Addon
metadata:
name: 'mariadb-addon'
labels:
{{- include "kubedb-kubestash-catalog.labels" . | nindent 4 }}
spec:
backupTasks:
- driver: Restic
executor: Job
function: mariadb-backup
name: logical-backup
parameters:
- name: args
required: false
usage: Arguments to be passed to the dump command.
- name: databases
required: false
usage: List of databases to backup.
- default: "true"
name: enableCache
required: false
usage: Enable or disable caching. Disabling caching may impact backup performance.
- default: /kubestash-tmp
name: scratchDir
required: false
usage: Directory for holding temporary files and restic cache.
singleton: true
volumeMounts:
- mountPath: /kubestash-tmp
name: kubestash-tmp-volume
volumeTemplate:
- name: kubestash-tmp-volume
source:
emptyDir: {}
usage: Holds temporary files and restic cache.
- driver: VolumeSnapshotter
executor: Job
function: mariadb-csi-snapshotter
name: volume-snapshot
parameters:
- name: volumeSnapshotClassName
required: false
usage: The VolumeSnapshotClassName to be used by volumeSnapshot
singleton: true
- driver: Restic
executor: Job
function: kubedbmanifest-backup
name: manifest-backup
parameters:
- default: "true"
name: enableCache
required: false
usage: Enable or disable caching. Disabling caching may impact backup performance.
- default: /kubestash-tmp
name: scratchDir
required: false
usage: Directory for holding temporary files and restic cache.
singleton: true
volumeMounts:
- mountPath: /kubestash-tmp
name: kubestash-tmp-volume
volumeTemplate:
- name: kubestash-tmp-volume
source:
emptyDir: {}
usage: Holds temporary files and restic cache.
restoreTasks:
- driver: Restic
executor: Job
function: mariadb-restore
name: logical-backup-restore
parameters:
- name: args
required: false
usage: Arguments to be passed to the dump command.
- default: "true"
name: enableCache
required: false
usage: Enable or disable caching. Disabling caching may impact backup performance.
- default: /kubestash-tmp
name: scratchDir
required: false
usage: Directory for holding temporary files and restic cache.
singleton: true
volumeMounts:
- mountPath: /kubestash-tmp
name: kubestash-tmp-volume
volumeTemplate:
- name: kubestash-tmp-volume
source:
emptyDir: {}
usage: Holds temporary files and restic cache.
- driver: Restic
executor: Job
function: kubedbmanifest-restore
name: manifest-restore
parameters:
- default: "true"
name: enableCache
required: false
usage: Enable or disable caching. Disabling caching may impact backup performance.
- default: /kubestash-tmp
name: scratchDir
required: false
usage: Directory for holding temporary files and restic cache.
singleton: true
volumeMounts:
- mountPath: /kubestash-tmp
name: kubestash-tmp-volume
volumeTemplate:
- name: kubestash-tmp-volume
source:
emptyDir: {}
usage: Holds temporary files and restic cache.
{{ end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{ $featureGates := .Values.featureGates }}
{{- if .Values.global }}
{{ $featureGates = mergeOverwrite dict .Values.featureGates .Values.global.featureGates }}
{{- end }}

{{ if $featureGates.MariaDB }}
apiVersion: addons.kubestash.com/v1alpha1
kind: Function
metadata:
name: 'mariadb-backup'
labels:
{{- include "kubedb-kubestash-catalog.labels" . | nindent 4 }}
spec:
args:
- backup
- --namespace=${namespace:=default}
- --backupsession=${backupSession:=}
- --enable-cache=${enableCache:=}
- --scratch-dir=${scratchDir:=}
- --wait-timeout=${waitTimeout:={{ .Values.waitTimeout}}}
- --mariadb-args=${args:={{ .Values.mariadb.args }}}
- --db-version=${dbVersion:=}
- --databases=${databases:=}
image: '{{ include "image.ghcr" (merge (dict "_repo" "kubedb/mariadb-restic-plugin") $) }}:v0.4.0-beta.1_${DB_VERSION}'
{{ end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{ $featureGates := .Values.featureGates }}
{{- if .Values.global }}
{{ $featureGates = mergeOverwrite dict .Values.featureGates .Values.global.featureGates }}
{{- end }}

{{ if $featureGates.MariaDB }}
apiVersion: addons.kubestash.com/v1alpha1
kind: Function
metadata:
name: 'mariadb-csi-snapshotter'
labels:
{{- include "kubedb-kubestash-catalog.labels" . | nindent 4 }}
spec:
args:
- backup
- --namespace=${namespace:=default}
- --volume-snapshot-class-name=${volumeSnapshotClassName:=}
- --backupsession=${backupSession:=}
image: '{{ include "image.ghcr" (merge (dict "_repo" "kubedb/mariadb-csi-snapshotter-plugin") $) }}:v0.2.0-beta.1'
{{ end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{ $featureGates := .Values.featureGates }}
{{- if .Values.global }}
{{ $featureGates = mergeOverwrite dict .Values.featureGates .Values.global.featureGates }}
{{- end }}

{{ if $featureGates.MariaDB }}
apiVersion: addons.kubestash.com/v1alpha1
kind: Function
metadata:
name: 'mariadb-restore'
labels:
{{- include "kubedb-kubestash-catalog.labels" . | nindent 4 }}
spec:
args:
- restore
- --namespace=${namespace:=default}
- --restoresession=${restoreSession:=}
- --snapshot=${snapshot:=}
- --enable-cache=${enableCache:=}
- --scratch-dir=${scratchDir:=}
- --wait-timeout=${waitTimeout:={{ .Values.waitTimeout}}}
- --mariadb-args=${args:={{ .Values.mariadb.args }}}
- --db-version=${dbVersion:=}
image: '{{ include "image.ghcr" (merge (dict "_repo" "kubedb/mariadb-restic-plugin") $) }}:v0.4.0-beta.1_${DB_VERSION}'
{{ end }}
8 changes: 8 additions & 0 deletions charts/kubedb-kubestash-catalog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ mysql:
restore:
# Arguments to pass to `mysql` command during restore process
args: ""
mariadb:
# optional argument to send mariadbdump or mariadb command
backup:
# Arguments to pass to `mariadbdump` command during bakcup process
args: ""
restore:
# Arguments to pass to `mariadb` command during restore process
args: ""
redis:
# optional argument to send redis-dump or redis command
backup:
Expand Down

0 comments on commit 9690c81

Please sign in to comment.