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 support for backup #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
24 changes: 24 additions & 0 deletions charts/templates/mongodb-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -357,3 +357,27 @@ spec:
additionalCertificateDomains: {{ .Values.sharding.extAccess.externalDomains }}
{{- end }}
{{- end }}
backup:
mode: {{ .Values.backup.mode }}
assignmentLabels: ""
{{- if and (hasKey .Values "sharding") (hasKey .Values.sharding "enabled") (eq .Values.sharding.enabled false) }}
autoTerminateOnDeletion: {{ .Values.backup.autoTerminateOnDeletion }}
{{- end }}
encryption:
kmip:
client:
clientCertificatePrefix: {{ .Values.backup.encryption.kmip.client.clientCertificatePrefix }}
snapshotSchedule:
snapshotIntervalHours: {{ .Values.backup.snapshotSchedule.snapshotIntervalHours }}
snapshotRetentionDays: {{ .Values.backup.snapshotSchedule.snapshotRetentionDays }}
dailySnapshotRetentionDays: {{ .Values.backup.snapshotSchedule.dailySnapshotRetentionDays }}
weeklySnapshotRetentionWeeks: {{ .Values.backup.snapshotSchedule.weeklySnapshotRetentionWeeks }}
monthlySnapshotRetentionMonths: {{ .Values.backup.snapshotSchedule.monthlySnapshotRetentionMonths }}
pointInTimeWindowHours: {{ .Values.backup.snapshotSchedule.pointInTimeWindowHours }}
referenceHourOfDay: {{ .Values.backup.snapshotSchedule.referenceHourOfDay }}
referenceMinuteOfHour: {{ .Values.backup.snapshotSchedule.referenceMinuteOfHour }}
fullIncrementalDayOfWeek: {{ .Values.backup.snapshotSchedule.fullIncrementalDayOfWeek }}
{{- if and (hasKey .Values "sharding") (hasKey .Values.sharding "enabled") (eq .Values.sharding.enabled true) (and (lt .FeatureCompatibilityVersion "4.1")) }}
clusterCheckpointIntervalMin: {{ .Values.backup.snapshotSchedule.clusterCheckpointIntervalMin }}
{{- end }}
{{- end }}
19 changes: 19 additions & 0 deletions examples/replica_set_single_disk/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,22 @@ additionalUsers:
role: "readWriteAnyDatabase"
- db: admin
role: "userAdminAnyDatabase"

backup:
mode: enabled
autoTerminateOnDeletion: false
encryption:
kmip:
client:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a bad idea as MEKO turns KMIP on and off based on the existence of the .spec.encryption.kmip. Putting an empty element here might lead to errors.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added validation to verify whether encryption is enabled or not in the charts/templates/mongodb-deployment.yaml file.

clientCertificatePrefix: ""
snapshotSchedule:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for the record, the same thing happens here. Providing empty values is not the same as not providing this at all.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also added validation to verify if value of clientCertificatePrefix is empty string, then to not include encryption block at all.

snapshotIntervalHours: 6
snapshotRetentionDays: 3
dailySnapshotRetentionDays: 7
weeklySnapshotRetentionWeeks: 4
monthlySnapshotRetentionMonths: 0
pointInTimeWindowHours: 24
referenceHourOfDay: 0
referenceMinuteOfHour: 0
fullIncrementalDayOfWeek: "SUNDAY"
clusterCheckpointIntervalMin: 15