-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
[bitnami/influxdb] Allow separate persistence cfg for backups #24586
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -50,9 +50,12 @@ spec: | |||||||||||
{{- end }} | ||||||||||||
{{- end }} | ||||||||||||
- name: {{ include "common.names.fullname" . }}-backups | ||||||||||||
{{- if .Values.persistence.enabled }} | ||||||||||||
{{- if .Values.backup.persistence.enabled }} | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
persistentVolumeClaim: | ||||||||||||
claimName: {{ include "common.names.fullname" . }}-backups | ||||||||||||
claimName: {{ default (printf "%s-%s" (include "common.names.fullname" . ) "backups") .Values.backup.persistence.existingClaim }} | ||||||||||||
{{- else if .Values.persistence.enabled }} | ||||||||||||
persistentVolumeClaim: | ||||||||||||
claimName: {{ default (printf "%s-%s" (include "common.names.fullname" . ) "backups") .Values.persistence.existingClaim }} | ||||||||||||
Comment on lines
+55
to
+58
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
It may be worth a helper function here, for similarity with
Note that I'm also deliberately suggesting here to not take into account |
||||||||||||
{{- else }} | ||||||||||||
emptyDir: {} | ||||||||||||
{{- end }} | ||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -2,26 +2,33 @@ | |||||||||||||||||||||
Copyright Broadcom, Inc. All Rights Reserved. | ||||||||||||||||||||||
SPDX-License-Identifier: APACHE-2.0 | ||||||||||||||||||||||
*/}} | ||||||||||||||||||||||
|
||||||||||||||||||||||
{{- if and .Values.backup.enabled .Values.persistence.enabled (not .Values.persistence.existingClaim) }} | ||||||||||||||||||||||
{{- | ||||||||||||||||||||||
/* | ||||||||||||||||||||||
Prefer .Values.backup.persistence, but fall back to .Values.persistence if not present. | ||||||||||||||||||||||
*/ | ||||||||||||||||||||||
-}} | ||||||||||||||||||||||
{{- if .Values.backup.enabled }} | ||||||||||||||||||||||
{{ $persistence := coalesce .Values.backup.persistence .Values.persistence }} | ||||||||||||||||||||||
{{ if and $persistence.enabled (not $persistence.existingClaim) }} | ||||||||||||||||||||||
Comment on lines
+5
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
kind: PersistentVolumeClaim | ||||||||||||||||||||||
apiVersion: v1 | ||||||||||||||||||||||
metadata: | ||||||||||||||||||||||
name: {{ include "common.names.fullname" . }}-backups | ||||||||||||||||||||||
namespace: {{ include "common.names.namespace" . | quote }} | ||||||||||||||||||||||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} | ||||||||||||||||||||||
name: {{ include "common.names.fullname" $ }}-backups | ||||||||||||||||||||||
namespace: {{ include "common.names.namespace" $ | quote }} | ||||||||||||||||||||||
labels: {{- include "common.labels.standard" ( dict "customLabels" $.Values.commonLabels "context" $ ) | nindent 4 }} | ||||||||||||||||||||||
Comment on lines
+16
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would keep the original contexts
Suggested change
|
||||||||||||||||||||||
app.kubernetes.io/component: influxdb | ||||||||||||||||||||||
{{- if or .Values.persistence.annotations .Values.commonAnnotations }} | ||||||||||||||||||||||
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.persistence.annotations .Values.commonAnnotations ) "context" . ) }} | ||||||||||||||||||||||
{{- if or $persistence.annotations $.Values.commonAnnotations }} | ||||||||||||||||||||||
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list $persistence.annotations $.Values.commonAnnotations ) "context" $ ) }} | ||||||||||||||||||||||
Comment on lines
+20
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} | ||||||||||||||||||||||
{{- end }} | ||||||||||||||||||||||
spec: | ||||||||||||||||||||||
accessModes: | ||||||||||||||||||||||
{{- range .Values.persistence.accessModes }} | ||||||||||||||||||||||
{{- range $persistence.accessModes }} | ||||||||||||||||||||||
- {{ . | quote }} | ||||||||||||||||||||||
{{- end }} | ||||||||||||||||||||||
resources: | ||||||||||||||||||||||
requests: | ||||||||||||||||||||||
storage: {{ .Values.persistence.size | quote }} | ||||||||||||||||||||||
{{- include "common.storage.class" ( dict "persistence" .Values.persistence "global" $) | nindent 2 }} | ||||||||||||||||||||||
storage: {{ $persistence.size | quote }} | ||||||||||||||||||||||
{{- include "common.storage.class" ( dict "persistence" $persistence "global" $) | nindent 2 }} | ||||||||||||||||||||||
{{- end }} | ||||||||||||||||||||||
{{- end }} |
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -924,6 +924,36 @@ backup: | |||||||||||||||
## @param backup.retentionDays Retention time in days for backups (older backups are deleted) | ||||||||||||||||
## | ||||||||||||||||
retentionDays: 10 | ||||||||||||||||
|
||||||||||||||||
## Persistence parameters | ||||||||||||||||
## | ||||||||||||||||
persistence: | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
## @param backup.persistence.enabled Enable data persistence for backup volume | ||||||||||||||||
## | ||||||||||||||||
enabled: false | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
## @param backup.persistence.existingClaim Use a existing PVC which must be created manually before bound | ||||||||||||||||
## If defined, PVC must be created manually before volume will be bound | ||||||||||||||||
## The value is evaluated as a template | ||||||||||||||||
## | ||||||||||||||||
existingClaim: "" | ||||||||||||||||
## @param backup.persistence.storageClass Specify the `storageClass` used to provision the volume | ||||||||||||||||
## If defined, storageClassName: <storageClass> | ||||||||||||||||
## If set to "-", storageClassName: "", which disables dynamic provisioning | ||||||||||||||||
## If undefined (the default) or set to null, no storageClassName spec is | ||||||||||||||||
## set, choosing the default provisioner. | ||||||||||||||||
## | ||||||||||||||||
storageClass: "" | ||||||||||||||||
## @param backup.persistence.accessModes Access mode of data volume | ||||||||||||||||
## | ||||||||||||||||
accessModes: | ||||||||||||||||
- ReadWriteOnce | ||||||||||||||||
## @param backup.persistence.size Size of data volume | ||||||||||||||||
## | ||||||||||||||||
size: 8Gi | ||||||||||||||||
## @param backup.persistence.annotations Persistent Volume Claim annotations | ||||||||||||||||
## | ||||||||||||||||
annotations: {} | ||||||||||||||||
|
||||||||||||||||
## Cronjob configuration | ||||||||||||||||
## This cronjob is used to create InfluxDB™ backups | ||||||||||||||||
## | ||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify: if someone doesn't set
backup.persistence.ownConfig: true
, and they havepersistence.existingClaim
set to some volume, should the effective value ofbackup.persistence.existingClaim
be the same? That would lead to binding of the same target volume, which is the RWO problem I mentioned.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If someone has
backup.persistence.ownConfig: false
(which is the proposed default, at least on this first version) the chart will have the very same behavior than the current version and anybackup.persistence.*
parameter will be ignored.Any bugs present in the current version will still be there unless you explicitly set
backup.persistence.ownConfig: true
. Then, you have all the flexibility you want, right?