diff --git a/charts/postgres-cluster/Chart.yaml b/charts/postgres-cluster/Chart.yaml index c71a4d5..aed7e26 100644 --- a/charts/postgres-cluster/Chart.yaml +++ b/charts/postgres-cluster/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: postgres-cluster -version: 7.3.0 +version: 7.4.0 description: Cloudnative-pg Cluster keywords: - database diff --git a/charts/postgres-cluster/README.md b/charts/postgres-cluster/README.md index 66b8630..70b908f 100644 --- a/charts/postgres-cluster/README.md +++ b/charts/postgres-cluster/README.md @@ -1,6 +1,6 @@ # postgres-cluster -![Version: 7.3.0](https://img.shields.io/badge/Version-7.3.0-informational?style=flat-square) ![AppVersion: v1.28.0](https://img.shields.io/badge/AppVersion-v1.28.0-informational?style=flat-square) +![Version: 7.4.0](https://img.shields.io/badge/Version-7.4.0-informational?style=flat-square) ![AppVersion: v1.28.0](https://img.shields.io/badge/AppVersion-v1.28.0-informational?style=flat-square) Cloudnative-pg Cluster @@ -65,7 +65,7 @@ Cloudnative-pg Cluster | nameOverride | string | `""` | Override the name of the cluster | | namespaceOverride | string | `""` | Override the namespace of the chart | | poolers | list | `[]` | List of PgBouncer poolers | -| recovery | object | `{"backup":{"backupName":"","database":"app","owner":"","pitrTarget":{"time":""}},"import":{"databases":[],"pgDumpExtraOptions":[],"pgRestoreExtraOptions":[],"postImportApplicationSQL":[],"roles":[],"schemaOnly":false,"source":{"database":"app","host":"","passwordSecret":{"create":false,"key":"password","name":"","value":""},"port":5432,"sslCertSecret":{"key":"","name":""},"sslKeySecret":{"key":"","name":""},"sslMode":"verify-full","sslRootCertSecret":{"key":"","name":""},"username":"app"},"type":"microservice"},"method":"backup","objectStore":{"clusterName":"","data":{"compression":"snappy","encryption":"","jobs":1},"database":"app","destinationBucket":"postgres-backups","destinationPathOverride":"","endpointCA":{"create":false,"key":"","name":""},"endpointCredentials":"","endpointCredentialsIncludeRegion":true,"endpointURL":"http://garage-main.garage:3900","externalSecret":{"credentialPath":"/garage/home-infra/postgres-backups","enabled":true},"index":1,"owner":"","pitrTarget":{"time":""},"wal":{"compression":"snappy","encryption":"","maxParallel":1}},"pgBaseBackup":{"database":"app","owner":"","secret":"","source":{"database":"app","host":"","passwordSecret":{"create":false,"key":"password","name":"","value":""},"port":5432,"sslCertSecret":{"key":"","name":""},"sslKeySecret":{"key":"","name":""},"sslMode":"disable","sslRootCertSecret":{"key":"","name":""},"username":""}}}` | Recovery settings when booting cluster from external cluster | +| recovery | object | `{"backup":{"backupName":"","database":"app","owner":"","pitrTarget":{"time":""}},"import":{"databases":[],"pgDumpExtraOptions":[],"pgRestoreExtraOptions":[],"postImportApplicationSQL":[],"roles":[],"schemaOnly":false,"source":{"database":"app","host":"","passwordSecret":{"create":false,"key":"password","name":"","value":""},"port":5432,"sslCertSecret":{"key":"","name":""},"sslKeySecret":{"key":"","name":""},"sslMode":"verify-full","sslRootCertSecret":{"key":"","name":""},"username":"app"},"type":"microservice"},"method":"backup","objectStore":{"clusterName":"","data":{"compression":"snappy","encryption":"","jobs":1},"database":"app","destinationBucket":"postgres-backups","destinationPathOverride":"","endpointCA":{"create":false,"key":"","name":""},"endpointCredentials":"","endpointCredentialsIncludeRegion":true,"endpointURL":"http://garage-main.garage:3900","externalSecret":{"credentialPath":"/garage/home-infra/postgres-backups","enabled":true},"index":1,"owner":"","pitrTarget":{"time":""},"wal":{"compression":"snappy","encryption":"","maxParallel":1}}}` | Recovery settings when booting cluster from external cluster | | recovery.backup.backupName | string | `""` | Name of the backup to recover from. | | recovery.backup.database | string | `"app"` | Name of the database used by the application. Default: `app`. | | recovery.backup.owner | string | `""` | Name of the owner of the database in the instance to be used by applications. Defaults to the value of the `database` key. | @@ -83,7 +83,7 @@ Cloudnative-pg Cluster | recovery.import.source.passwordSecret.name | string | `""` | Name of the secret containing the password | | recovery.import.source.passwordSecret.value | string | `""` | The password value to use when creating the secret | | recovery.import.type | string | `"microservice"` | One of `microservice` or `monolith.` See: https://cloudnative-pg.io/documentation/current/database_import/#how-it-works | -| recovery.method | string | `"backup"` | Available recovery methods: * `backup` - Recovers a CNPG cluster from a CNPG backup (PITR supported) Needs to be on the same cluster in the same namespace. * `objectStore` - Recovers a CNPG cluster from a barman object store (PITR supported). * `pgBaseBackup` - Recovers a CNPG cluster viaa streaming replication protocol. Useful if you want to migrate databases to CloudNativePG, even from outside Kubernetes. * `import` - Import one or more databases from an existing Postgres cluster. | +| recovery.method | string | `"backup"` | Available recovery methods: * `backup` - Recovers a CNPG cluster from a CNPG backup (PITR supported) Needs to be on the same cluster in the same namespace. * `objectStore` - Recovers a CNPG cluster from a barman object store (PITR supported). * `import` - Import one or more databases from an existing Postgres cluster. | | recovery.objectStore.clusterName | string | `""` | Override the name of the backup cluster, defaults to "cluster.name" | | recovery.objectStore.data.compression | string | `"snappy"` | Data compression method. One of `` (for no compression), `gzip`, `bzip2` or `snappy`. | | recovery.objectStore.data.encryption | string | `""` | Whether to instruct the storage provider to encrypt data files. One of `` (use the storage container default), `AES256` or `aws:kms`. | @@ -105,14 +105,6 @@ Cloudnative-pg Cluster | recovery.objectStore.wal.compression | string | `"snappy"` | WAL compression method. One of `` (for no compression), `gzip`, `bzip2` or `snappy`. | | recovery.objectStore.wal.encryption | string | `""` | Whether to instruct the storage provider to encrypt WAL files. One of `` (use the storage container default), `AES256` or `aws:kms`. | | recovery.objectStore.wal.maxParallel | int | `1` | Number of WAL files to be archived or restored in parallel. | -| recovery.pgBaseBackup.database | string | `"app"` | Name of the database used by the application. Default: `app`. | -| recovery.pgBaseBackup.owner | string | `""` | Name of the owner of the database in the instance to be used by applications. Defaults to the value of the `database` key. | -| recovery.pgBaseBackup.secret | string | `""` | Name of the secret containing the initial credentials for the owner of the user database. If empty a new secret will be created from scratch | -| recovery.pgBaseBackup.source | object | `{"database":"app","host":"","passwordSecret":{"create":false,"key":"password","name":"","value":""},"port":5432,"sslCertSecret":{"key":"","name":""},"sslKeySecret":{"key":"","name":""},"sslMode":"disable","sslRootCertSecret":{"key":"","name":""},"username":""}` | Configuration for the source database | -| recovery.pgBaseBackup.source.passwordSecret.create | bool | `false` | Whether to create a secret for the password | -| recovery.pgBaseBackup.source.passwordSecret.key | string | `"password"` | The key in the secret containing the password | -| recovery.pgBaseBackup.source.passwordSecret.name | string | `""` | Name of the secret containing the password | -| recovery.pgBaseBackup.source.passwordSecret.value | string | `""` | The password value to use when creating the secret | | type | string | `"postgresql"` | Type of the CNPG database. Available types: * `postgresql` | ---------------------------------------------- diff --git a/charts/postgres-cluster/templates/_bootstrap.tpl b/charts/postgres-cluster/templates/_bootstrap.tpl index 4c18908..68315a2 100644 --- a/charts/postgres-cluster/templates/_bootstrap.tpl +++ b/charts/postgres-cluster/templates/_bootstrap.tpl @@ -23,21 +23,7 @@ bootstrap: {{- else if eq .Values.mode "recovery" -}} bootstrap: - {{- if eq .Values.recovery.method "pgBaseBackup" }} - pg_basebackup: - source: pgBaseBackupSource - {{ with .Values.recovery.pgBaseBackup.database }} - database: {{ . }} - {{- end }} - {{ with .Values.recovery.pgBaseBackup.owner }} - owner: {{ . }} - {{- end }} - {{ with .Values.recovery.pgBaseBackup.secret }} - secret: - {{- toYaml . | nindent 6 }} - {{- end }} - - {{- else if eq .Values.recovery.method "import" }} + {{- if eq .Values.recovery.method "import" }} initdb: {{- with .Values.cluster.initdb }} {{- with (omit . "owner" "import" "postInitApplicationSQL") }} diff --git a/charts/postgres-cluster/templates/_external_clusters.tpl b/charts/postgres-cluster/templates/_external_clusters.tpl index d164a95..f2e401d 100644 --- a/charts/postgres-cluster/templates/_external_clusters.tpl +++ b/charts/postgres-cluster/templates/_external_clusters.tpl @@ -2,10 +2,7 @@ externalClusters: {{- if eq .Values.mode "standalone" }} {{- else if eq .Values.mode "recovery" }} - {{- if eq .Values.recovery.method "pgBaseBackup" }} - - name: pgBaseBackupSource - {{- include "cluster.externalSourceCluster" .Values.recovery.pgBaseBackup.source | nindent 4 }} - {{- else if eq .Values.recovery.method "import" }} + {{- if eq .Values.recovery.method "import" }} - name: importSource {{- include "cluster.externalSourceCluster" .Values.recovery.import.source | nindent 4 }} {{- else if eq .Values.recovery.method "objectStore" }} @@ -15,7 +12,7 @@ externalClusters: enabled: true isWALArchiver: false parameters: - barmanObjectName: "{{ include "cluster.name" . }}-{{ .Values.recovery.objectStore.name }}" + barmanObjectName: "{{ include "cluster.name" . }}-recovery" serverName: {{ include "cluster.recoveryServerName" . }} {{- end }} {{- else }} diff --git a/charts/postgres-cluster/values.yaml b/charts/postgres-cluster/values.yaml index 5266c51..cc5f79d 100644 --- a/charts/postgres-cluster/values.yaml +++ b/charts/postgres-cluster/values.yaml @@ -224,8 +224,6 @@ recovery: # -- Available recovery methods: # * `backup` - Recovers a CNPG cluster from a CNPG backup (PITR supported) Needs to be on the same cluster in the same namespace. # * `objectStore` - Recovers a CNPG cluster from a barman object store (PITR supported). - # * `pgBaseBackup` - Recovers a CNPG cluster viaa streaming replication protocol. Useful if you want to - # migrate databases to CloudNativePG, even from outside Kubernetes. # * `import` - Import one or more databases from an existing Postgres cluster. method: backup @@ -324,48 +322,6 @@ recovery: # -- Number of data files to be archived or restored in parallel. jobs: 1 - # See https://cloudnative-pg.io/documentation/current/bootstrap/#bootstrap-from-a-live-cluster-pg_basebackup - pgBaseBackup: - - # -- Name of the database used by the application. Default: `app`. - database: app - - # -- Name of the secret containing the initial credentials for the owner of the user database. If empty a new secret will be created from scratch - secret: "" - - # -- Name of the owner of the database in the instance to be used by applications. Defaults to the value of the `database` key. - owner: "" - - # -- Configuration for the source database - source: - host: "" - port: 5432 - username: "" - database: "app" - sslMode: "disable" - passwordSecret: - - # -- Whether to create a secret for the password - create: false - - # -- Name of the secret containing the password - name: "" - - # -- The key in the secret containing the password - key: "password" - - # -- The password value to use when creating the secret - value: "" - sslKeySecret: - name: "" - key: "" - sslCertSecret: - name: "" - key: "" - sslRootCertSecret: - name: "" - key: "" - # See: https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-Import import: