Files
helm-charts/charts/postgres-cluster/templates/object-store.yaml
Alex Lebens 6dd28a27b0
All checks were successful
lint-and-test / lint-helm (push) Successful in 8s
lint-and-test / chart-testing (push) Successful in 18s
release-charts-postgres-cluster / release (push) Successful in 24s
renovate / renovate (push) Successful in 32s
change default retention
2025-12-22 22:53:17 -06:00

104 lines
3.6 KiB
YAML

{{ if (eq .Values.backup.method "objectStore") }}
{{ $context := . -}}
{{ range .Values.backup.objectStore -}}
---
apiVersion: barmancloud.cnpg.io/v1
kind: ObjectStore
metadata:
name: {{ include "cluster.name" $context }}-backup-{{ .name }}
namespace: {{ include "cluster.namespace" $context }}
labels:
{{- include "cluster.labels" $context | nindent 4 }}
app.kubernetes.io/name: {{ include "cluster.name" $context }}-backup-{{ .name }}
{{- with $context.Values.cluster.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
retentionPolicy: {{ .retentionPolicy | default "7d" }}
configuration:
destinationPath: {{ include "cluster.backupDestinationPath" (dict "instance" . "global" $context) }}
endpointURL: {{ .endpointURL | default "http://garage-main.garage:3900" }}
{{- if .endpointCA }}
endpointCA:
name: {{ .endpointCA.name }}
key: {{ .endpointCA.key }}
{{- end }}
{{- if .wal }}
wal:
compression: {{ .wal.compression | default "snappy" }}
{{ with .wal.encryption }}
encryption: {{ . }}
{{ end }}
maxParallel: {{ .wal.maxParallel | default "1" }}
{{- end }}
{{- if .data }}
data:
compression: {{ .data.compression | default "snappy" }}
{{- with .data.encryption }}
encryption: {{ . }}
{{- end }}
jobs: {{ .data.jobs | default 1 }}
{{- end }}
s3Credentials:
accessKeyId:
name: {{ include "cluster.backupSecretName" (dict "instance" . "global" $context) }}
key: ACCESS_KEY_ID
secretAccessKey:
name: {{ include "cluster.backupSecretName" (dict "instance" . "global" $context) }}
key: ACCESS_SECRET_KEY
{{- if .endpointCredentialsIncludeRegion }}
region:
name: {{ include "cluster.backupSecretName" (dict "instance" . "global" $context) }}
key: ACCESS_REGION
{{- end }}
{{ end -}}
{{ end }}
{{ if eq .Values.recovery.method "objectStore" }}
---
apiVersion: barmancloud.cnpg.io/v1
kind: ObjectStore
metadata:
name: "{{ include "cluster.name" . }}-recovery"
namespace: {{ include "cluster.namespace" . }}
labels:
{{- include "cluster.labels" . | nindent 4 }}
app.kubernetes.io/name: "{{ include "cluster.name" . }}-recovery"
{{- with .Values.cluster.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
configuration:
destinationPath: {{ include "cluster.recoveryDestinationPath" . }}
endpointURL: {{ .Values.recovery.objectStore.endpointURL }}
{{- if .Values.recovery.objectStore.endpointCA.name }}
endpointCA:
name: {{ .Values.recovery.objectStore.endpointCA.name }}
key: {{ .Values.recovery.objectStore.endpointCA.key }}
{{- end }}
wal:
compression: {{ .Values.recovery.objectStore.wal.compression }}
{{- with .Values.recovery.objectStore.wal.encryption}}
encryption: {{ . }}
{{- end }}
maxParallel: {{ .Values.recovery.objectStore.wal.maxParallel }}
data:
compression: {{ .Values.recovery.objectStore.data.compression }}
{{- with .Values.recovery.objectStore.data.encryption }}
encryption: {{ . }}
{{- end }}
jobs: {{ .Values.recovery.objectStore.data.jobs }}
s3Credentials:
accessKeyId:
name: {{ include "cluster.recoverySecretName" . }}
key: ACCESS_KEY_ID
secretAccessKey:
name: {{ include "cluster.recoverySecretName" . }}
key: ACCESS_SECRET_KEY
{{- if .Values.recovery.objectStore.endpointCredentialsIncludeRegion }}
region:
name: {{ include "cluster.recoverySecretName" . }}
key: ACCESS_REGION
{{- end }}
{{ end }}