Skip to content

Commit

Permalink
fix(cnpg-cluster): backup with external secret config
Browse files Browse the repository at this point in the history
  • Loading branch information
Tassatux committed Aug 9, 2024
1 parent 04c231a commit 62aec4f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/cnpg-cluster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: cnpg-cluster
description: A Helm chart to create cloudnative-pg.io clusters
type: application
version: 1.4.0
version: 2.0.0
appVersion: "14.5-6"
9 changes: 8 additions & 1 deletion charts/cnpg-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ The command removes all the Kubernetes components associated with the chart and
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| backup.azureCredentials | object | `nil` | The credentials to use to upload data to Azure Blob Storage See: https://cloudnative-pg.io/documentation/1.17/api_reference/#AzureCredentials |
| backup.createSecret | bool | `false` | Enable the secret creation for the backup credentials |
| backup.data | object | `{}` | Configuration of the backup of the data directory See: https://cloudnative-pg.io/documentation/1.17/api_reference/#DataBackupConfiguration |
| backup.destinationPath | string | `""` | The path where to store the backup (i.e. s3://bucket/path/to/folder) this path, with different destination folders, will be used for WALs and for data -- |
| backup.enabled | bool | `false` | Enable backups |
Expand Down Expand Up @@ -84,6 +83,14 @@ The command removes all the Kubernetes components associated with the chart and
| scheduledBackups | object | `{}` | ScheduledBackup resources to create for this Cluster resource See: https://cloudnative-pg.io/documentation/1.17/api_reference/#ScheduledBackupSpec |
| tolerations | list | `[]` | Postgres instances labels for tolerations pod assignment |

## Upgrading

### To 2.0.0

This major bump changes the following backup settings:
* fix a discrepancy between doc and template, the parameter `secretName` previously a root value is now under `backup`: `backup.secretName`.
* remove `backup.createSecret` parameter, secret is created by default unless `backup.secretName` is provided.

## License

Copyright (c) 2022 ENIX
Expand Down
8 changes: 8 additions & 0 deletions charts/cnpg-cluster/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ The command removes all the Kubernetes components associated with the chart and

{{ template "chart.valuesSection" . }}

## Upgrading

### To 2.0.0

This major bump changes the following backup settings:
* fix a discrepancy between doc and template, the parameter `secretName` previously a root value is now under `backup`: `backup.secretName`.
* remove `backup.createSecret` parameter, secret is created by default unless `backup.secretName` is provided.

## License

Copyright (c) 2022 ENIX
Expand Down
2 changes: 1 addition & 1 deletion charts/cnpg-cluster/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ app.kubernetes.io/instance: {{ .Release.Name }}
Backup secret name
*/}}
{{- define "cnpg-cluster.backupSecretName" -}}
{{ or .Values.secretName (print (include "cnpg-cluster.fullname" .) `-backup`) }}
{{ or .Values.backup.secretName (print (include "cnpg-cluster.fullname" .) `-backup`) }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/cnpg-cluster/templates/backup.secret.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.backup.enabled .Values.backup.createSecret }}
{{- if and .Values.backup.enabled (not .Values.backup.secretName) }}
apiVersion: v1
kind: Secret
metadata:
Expand Down
3 changes: 0 additions & 3 deletions charts/cnpg-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ backup:
# -- Override secret name for the backup credentials
secretName:

# -- Enable the secret creation for the backup credentials
createSecret: false

# -- (object) The credentials to use to upload data to Google Cloud Storage
# See: https://cloudnative-pg.io/documentation/1.17/api_reference/#GoogleCredentials
googleCredentials:
Expand Down

0 comments on commit 62aec4f

Please sign in to comment.