Skip to content
Draft
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{{- if and (eq .Values.spec.backup.tool "KubeStash") (.Values.spec.admin.backup.enable.default) (eq .Values.spec.admin.backup.by "BackupConfiguration") -}}

apiVersion: core.kubestash.com/v1alpha1
kind: BackupConfiguration
metadata:
name: {{ include "kubedbcom-oracle-editor-options.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "kubedbcom-oracle-editor-options.labels" . | nindent 4 }}
spec:
target:
apiGroup: kubedb.com
kind: Oracle
name: {{ include "kubedbcom-oracle-editor-options.fullname" . }}
namespace: {{ .Release.Namespace }}
backends:
- name: default-backend
storageRef:
name: {{ .Values.spec.backup.kubestash.storageRef.name }}
namespace: {{ .Values.spec.backup.kubestash.storageRef.namespace }}
retentionPolicy:
name: {{ .Values.spec.backup.kubestash.retentionPolicy.name }}
namespace: {{ .Values.spec.backup.kubestash.retentionPolicy.namespace }}
sessions:
- name: full-backup
sessionHistoryLimit: 3
scheduler:
schedule: {{ .Values.spec.backup.kubestash.schedule | quote }}
jobTemplate:
template:
spec:
containerSecurityContext:
{{- include "container.securityContext" . | nindent 16 }}
nodeSelector:
kubernetes.io/os: linux
backoffLimit: 2
successfulJobsHistoryLimit: 2
failedJobsHistoryLimit: 4
repositories:
- name: {{ include "kubedbcom-oracle-editor-options.fullname" . }}
backend: default-backend
directory: {{ .Release.Namespace }}/{{ include "kubedbcom-oracle-editor-options.fullname" . }}
encryptionSecret:
name: {{ .Values.spec.backup.kubestash.encryptionSecret.name }}
namespace: {{ .Values.spec.backup.kubestash.encryptionSecret.namespace }}
addon:
name: oracle-addon
tasks:
- name: logical-backup
jobTemplate:
spec:
containerSecurityContext:
{{- include "container.securityContext" . | nindent 14 }}
nodeSelector:
kubernetes.io/os: linux
{{- end }}
4 changes: 2 additions & 2 deletions charts/kubedbcom-solr-editor-options/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ The following table lists the configurable parameters of the `kubedbcom-solr-edi
| spec.admin.customConfiguration | | <code>true</code> |
| spec.admin.deletionPolicy.default | | <code>WipeOut</code> |
| spec.admin.deletionPolicy.toggle | | <code>true</code> |
| spec.admin.backup.enable.default | | <code>false</code> |
| spec.admin.backup.enable.toggle | | <code>false</code> |
| spec.admin.backup.enable.default | | <code>true</code> |
| spec.admin.backup.enable.toggle | | <code>true</code> |
| spec.admin.backup.by | | <code>BackupConfiguration</code> |
| spec.admin.backup.via | | <code>Restic</code> |
| spec.admin.archiver.enable.default | | <code>false</code> |
Expand Down
13 changes: 13 additions & 0 deletions charts/kubedbcom-solr-editor-options/ui/create-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,19 @@ step:
name: isToggleOn|monitoring
type: function
type: block-layout
- if:
name: isToggleOn|backup
type: function
init:
type: func
value: setBackup
label: Enable Backup?
schema: temp/backup
type: switch
watcher:
func: onBackupSwitch
paths:
- temp/backup
- elements:
- if:
name: isToggleOn|tls
Expand Down
17 changes: 17 additions & 0 deletions charts/kubedbcom-solr-editor-options/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,21 @@ export const useFunc = (model) => {
return !!agent
}

function onBackupSwitch() {
const isBackupOn = getValue(discriminator, '/backup')
commit('wizard/model$update', {
path: '/spec/backup/tool',
value: isBackupOn ? 'KubeStash' : '',
force: true,
})
}

function setBackup() {
const backup = getValue(model, '/spec/backup/tool')
const val = getValue(model, '/spec/admin/backup/enable/default')
return backup === 'KubeStash' && features.includes('backup') && val
}

function setRequests(resource, type) {
const modelPath = type
? `/spec/${type}/podResources/resources/requests/${resource}`
Expand Down Expand Up @@ -1178,8 +1193,10 @@ export const useFunc = (model) => {
isRancherManaged,
isVariantAvailable,
onAuthChange,
onBackupSwitch,
onReferSecretChange,
returnFalse,
setBackup,
setLimits,
setMachineToCustom,
setMonitoring,
Expand Down
4 changes: 2 additions & 2 deletions charts/kubedbcom-solr-editor-options/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ spec:
toggle: true
backup:
enable:
default: false
toggle: false
default: true
toggle: true
by: BackupConfiguration
via: Restic
archiver:
Expand Down
Loading