Skip to content

Commit bd43e58

Browse files
josh-heyergithub-actions[bot]
authored andcommitted
Sync EnterpriseDB/cloud-native-postgres product/pg4k/v1.25.0
1 parent 1667332 commit bd43e58

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+9041
-726
lines changed

product_docs/docs/postgres_for_kubernetes/1/architecture.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,12 @@ only write inside a single Kubernetes cluster, at any time.
358358

359359
However, for business continuity objectives it is fundamental to:
360360

361-
- reduce global **recovery point objectives** (RPO) by storing PostgreSQL backup data
362-
in multiple locations, regions and possibly using different providers
363-
(Disaster Recovery)
364-
- reduce global **recovery time objectives** (RTO) by taking advantage of PostgreSQL
365-
replication beyond the primary Kubernetes cluster (High Availability)
361+
- reduce global **recovery point objectives** ([RPO](before_you_start.md#rpo))
362+
by storing PostgreSQL backup data in multiple locations, regions and possibly
363+
using different providers (Disaster Recovery)
364+
- reduce global **recovery time objectives** ([RTO](before_you_start.md#rto))
365+
by taking advantage of PostgreSQL replication beyond the primary Kubernetes
366+
cluster (High Availability)
366367

367368
In order to address the above concerns, EDB Postgres for Kubernetes introduces the concept of
368369
a PostgreSQL Topology that is distributed across different Kubernetes clusters

product_docs/docs/postgres_for_kubernetes/1/backup.mdx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ On the other hand, EDB Postgres for Kubernetes supports two ways to store physic
4444
the supported [Container Storage Interface (CSI) drivers](https://kubernetes-csi.github.io/docs/drivers.html)
4545
that provide snapshotting capabilities.
4646

47+
!!! Info
48+
Starting with version 1.25, EDB Postgres for Kubernetes includes experimental support for
49+
backup and recovery using plugins, such as the
50+
[Barman Cloud plugin](https://github.com/cloudnative-pg/plugin-barman-cloud).
51+
4752
## WAL archive
4853

4954
The WAL archive in PostgreSQL is at the heart of **continuous backup**, and it
@@ -69,7 +74,8 @@ as they can simply rely on the WAL archive to synchronize across long
6974
distances, extending disaster recovery goals across different regions.
7075

7176
When you [configure a WAL archive](wal_archiving.md), EDB Postgres for Kubernetes provides
72-
out-of-the-box an RPO <= 5 minutes for disaster recovery, even across regions.
77+
out-of-the-box an [RPO](before_you_start.md#rpo) <= 5 minutes for disaster
78+
recovery, even across regions.
7379

7480
!!! Important
7581
Our recommendation is to always setup the WAL archive in production.
@@ -121,9 +127,9 @@ including:
121127
- availability of a trusted storage class that supports volume snapshots
122128
- size of the database: with object stores, the larger your database, the
123129
longer backup and, most importantly, recovery procedures take (the latter
124-
impacts RTO); in presence of Very Large Databases (VLDB), the general
125-
advice is to rely on Volume Snapshots as, thanks to copy-on-write, they
126-
provide faster recovery
130+
impacts [RTO](before_you_start.md#rto)); in presence of Very Large Databases
131+
(VLDB), the general advice is to rely on Volume Snapshots as, thanks to
132+
copy-on-write, they provide faster recovery
127133
- data mobility and possibility to store or relay backup files on a
128134
secondary location in a different region, or any subsequent one
129135
- other factors, mostly based on the confidence and familiarity with the
@@ -190,7 +196,7 @@ In Kubernetes CronJobs, the equivalent expression is `0 0 * * *` because seconds
190196
are not included.
191197

192198
!!! Hint
193-
Backup frequency might impact your recovery time object (RTO) after a
199+
Backup frequency might impact your recovery time objective ([RTO](before_you_start.md#rto)) after a
194200
disaster which requires a full or Point-In-Time recovery operation. Our
195201
advice is that you regularly test your backups by recovering them, and then
196202
measuring the time it takes to recover from scratch so that you can refine

product_docs/docs/postgres_for_kubernetes/1/backup_barmanobjectstore.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ algorithms via `barman-cloud-backup` (for backups) and
9999
- snappy
100100

101101
The compression settings for backups and WALs are independent. See the
102-
[DataBackupConfiguration](https://pkg.go.dev/github.com/cloudnative-pg/barman-cloud/pkg/api#BarmanObjectStoreConfiguration) and
102+
[DataBackupConfiguration](https://pkg.go.dev/github.com/cloudnative-pg/barman-cloud/pkg/api#DataBackupConfiguration) and
103103
[WALBackupConfiguration](https://pkg.go.dev/github.com/cloudnative-pg/barman-cloud/pkg/api#WalBackupConfiguration) sections in
104-
the API reference.
104+
the barman-cloud API reference.
105105

106106
It is important to note that archival time, restore time, and size change
107107
between the algorithms, so the compression algorithm should be chosen according

product_docs/docs/postgres_for_kubernetes/1/before_you_start.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ PVC group
134134
belonging to the same PostgreSQL instance, namely the main volume containing
135135
the PGDATA (`storage`) and the volume for WALs (`walStorage`).
136136

137+
<a id="rto"></a>RTO
138+
: Acronym for "recovery time objective", the amount of time a system can be
139+
unavailable without adversely impacting the application.
140+
141+
<a id="rpo"></a>RPO
142+
: Acronym for "recovery point objective", a calculation of the level of
143+
acceptable data loss following a disaster recovery scenario.
144+
137145
## Cloud terminology
138146

139147
Region

product_docs/docs/postgres_for_kubernetes/1/bootstrap.mdx

Lines changed: 114 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ For more detailed information about this feature, please refer to the
3232
EDB Postgres for Kubernetes requires both the `postgres` user and database to
3333
always exists. Using the local Unix Domain Socket, it needs to connect
3434
as `postgres` user to the `postgres` database via `peer` authentication in
35-
order to perform administrative tasks on the cluster.
35+
order to perform administrative tasks on the cluster.
3636
**DO NOT DELETE** the `postgres` user or the `postgres` database!!!
3737

3838
!!! Info
@@ -212,36 +212,87 @@ The user that owns the database defaults to the database name instead.
212212
The application user is not used internally by the operator, which instead
213213
relies on the superuser to reconcile the cluster with the desired status.
214214

215-
### Passing options to `initdb`
215+
### Passing Options to `initdb`
216216

217-
The actual PostgreSQL data directory is created via an invocation of the
218-
`initdb` PostgreSQL command. If you need to add custom options to that command
219-
(i.e., to change the `locale` used for the template databases or to add data
220-
checksums), you can use the following parameters:
217+
The PostgreSQL data directory is initialized using the
218+
[`initdb` PostgreSQL command](https://www.postgresql.org/docs/current/app-initdb.html).
219+
220+
EDB Postgres for Kubernetes enables you to customize the behavior of `initdb` to modify
221+
settings such as default locale configurations and data checksums.
222+
223+
!!! Warning
224+
EDB Postgres for Kubernetes acts only as a direct proxy to `initdb` for locale-related
225+
options, due to the ongoing and significant enhancements in PostgreSQL's locale
226+
support. It is your responsibility to ensure that the correct options are
227+
provided, following the PostgreSQL documentation, and to verify that the
228+
bootstrap process completes successfully.
229+
230+
To include custom options in the `initdb` command, you can use the following
231+
parameters:
232+
233+
builtinLocale
234+
: When `builtinLocale` is set to a value, EDB Postgres for Kubernetes passes it to the
235+
`--builtin-locale` option in `initdb`. This option controls the builtin locale, as
236+
defined in ["Locale Support"](https://www.postgresql.org/docs/current/locale.html)
237+
from the PostgreSQL documentation (default: empty). Note that this option requires
238+
`localeProvider` to be set to `builtin`. Available from PostgreSQL 17.
221239

222240
dataChecksums
223-
: When `dataChecksums` is set to `true`, CNP invokes the `-k` option in
241+
: When `dataChecksums` is set to `true`, EDB Postgres for Kubernetes invokes the `-k` option in
224242
`initdb` to enable checksums on data pages and help detect corruption by the
225243
I/O system - that would otherwise be silent (default: `false`).
226244

227245
encoding
228-
: When `encoding` set to a value, CNP passes it to the `--encoding` option in `initdb`,
229-
which selects the encoding of the template database (default: `UTF8`).
246+
: When `encoding` set to a value, EDB Postgres for Kubernetes passes it to the `--encoding`
247+
option in `initdb`, which selects the encoding of the template database
248+
(default: `UTF8`).
249+
250+
icuLocale
251+
: When `icuLocale` is set to a value, EDB Postgres for Kubernetes passes it to the
252+
`--icu-locale` option in `initdb`. This option controls the ICU locale, as
253+
defined in ["Locale Support"](https://www.postgresql.org/docs/current/locale.html)
254+
from the PostgreSQL documentation (default: empty).
255+
Note that this option requires `localeProvider` to be set to `icu`.
256+
Available from PostgreSQL 15.
257+
258+
icuRules
259+
: When `icuRules` is set to a value, EDB Postgres for Kubernetes passes it to the
260+
`--icu-rules` option in `initdb`. This option controls the ICU locale, as
261+
defined in ["Locale
262+
Support"](https://www.postgresql.org/docs/current/locale.html) from the
263+
PostgreSQL documentation (default: empty). Note that this option requires
264+
`localeProvider` to be set to `icu`. Available from PostgreSQL 16.
265+
266+
locale
267+
: When `locale` is set to a value, EDB Postgres for Kubernetes passes it to the `--locale`
268+
option in `initdb`. This option controls the locale, as defined in
269+
["Locale Support"](https://www.postgresql.org/docs/current/locale.html) from
270+
the PostgreSQL documentation. By default, the locale parameter is empty. In
271+
this case, environment variables such as `LANG` are used to determine the
272+
locale. Be aware that these variables can vary between container images,
273+
potentially leading to inconsistent behavior.
230274

231275
localeCollate
232-
: When `localeCollate` is set to a value, CNP passes it to the `--lc-collate`
276+
: When `localeCollate` is set to a value, EDB Postgres for Kubernetes passes it to the `--lc-collate`
233277
option in `initdb`. This option controls the collation order (`LC_COLLATE`
234278
subcategory), as defined in ["Locale Support"](https://www.postgresql.org/docs/current/locale.html)
235279
from the PostgreSQL documentation (default: `C`).
236280

237281
localeCType
238-
: When `localeCType` is set to a value, CNP passes it to the `--lc-ctype` option in
282+
: When `localeCType` is set to a value, EDB Postgres for Kubernetes passes it to the `--lc-ctype` option in
239283
`initdb`. This option controls the collation order (`LC_CTYPE` subcategory), as
240284
defined in ["Locale Support"](https://www.postgresql.org/docs/current/locale.html)
241285
from the PostgreSQL documentation (default: `C`).
242286

287+
localeProvider
288+
: When `localeProvider` is set to a value, EDB Postgres for Kubernetes passes it to the `--locale-provider`
289+
option in `initdb`. This option controls the locale provider, as defined in
290+
["Locale Support"](https://www.postgresql.org/docs/current/locale.html) from the
291+
PostgreSQL documentation (default: empty, which means `libc` for PostgreSQL).
292+
Available from PostgreSQL 15.
293+
243294
walSegmentSize
244-
: When `walSegmentSize` is set to a value, CNP passes it to the `--wal-segsize`
295+
: When `walSegmentSize` is set to a value, EDB Postgres for Kubernetes passes it to the `--wal-segsize`
245296
option in `initdb` (default: not set - defined by PostgreSQL as 16 megabytes).
246297

247298
!!! Note
@@ -430,44 +481,59 @@ to the ["Recovery" section](recovery.md).
430481

431482
### Bootstrap from a live cluster (`pg_basebackup`)
432483

433-
The `pg_basebackup` bootstrap mode lets you create a new cluster (*target*) as
434-
an exact physical copy of an existing and **binary compatible** PostgreSQL
435-
instance (*source*), through a valid *streaming replication* connection.
436-
The source instance can be either a primary or a standby PostgreSQL server.
484+
The `pg_basebackup` bootstrap mode allows you to create a new cluster
485+
(*target*) as an exact physical copy of an existing and **binary-compatible**
486+
PostgreSQL instance (*source*) managed by EDB Postgres for Kubernetes, using a valid
487+
*streaming replication* connection. The source instance can either be a primary
488+
or a standby PostgreSQL server. It’s crucial to thoroughly review the
489+
requirements section below, as the pros and cons of PostgreSQL physical
490+
replication fully apply.
437491

438-
The primary use case for this method is represented by **migrations** to EDB Postgres for Kubernetes,
439-
either from outside Kubernetes or within Kubernetes (e.g., from another operator).
492+
The primary use cases for this method include:
440493

441-
!!! Warning
442-
The current implementation creates a *snapshot* of the origin PostgreSQL
443-
instance when the cloning process terminates and immediately starts
444-
the created cluster. See ["Current limitations"](#current-limitations) below for details.
494+
- Reporting and business intelligence clusters that need to be regenerated
495+
periodically (daily, weekly)
496+
- Test databases containing live data that require periodic regeneration
497+
(daily, weekly, monthly) and anonymization
498+
- Rapid spin-up of a standalone replica cluster
499+
- Physical migrations of EDB Postgres for Kubernetes clusters to different namespaces or
500+
Kubernetes clusters
445501

446-
Similar to the case of the `recovery` bootstrap method, once the clone operation
447-
completes, the operator will take ownership of the target cluster, starting from
448-
the first instance. This includes overriding some configuration parameters, as
449-
required by EDB Postgres for Kubernetes, resetting the superuser password, creating
450-
the `streaming_replica` user, managing the replicas, and so on. The resulting
451-
cluster will be completely independent of the source instance.
502+
!!! Important
503+
Avoid using this method, based on physical replication, to migrate an
504+
existing PostgreSQL cluster outside of Kubernetes into EDB Postgres for Kubernetes unless you
505+
are completely certain that all requirements are met and the operation has been
506+
thoroughly tested. The EDB Postgres for Kubernetes community does not endorse this approach
507+
for such use cases and recommends using logical import instead. It is
508+
exceedingly rare that all requirements for physical replication are met in a
509+
way that seamlessly works with EDB Postgres for Kubernetes.
510+
511+
!!! Warning
512+
In its current implementation, this method clones the source PostgreSQL
513+
instance, thereby creating a *snapshot*. Once the cloning process has finished,
514+
the new cluster is immediately started.
515+
Refer to ["Current limitations"](#current-limitations) for more details.
516+
517+
Similar to the `recovery` bootstrap method, once the cloning operation is
518+
complete, the operator takes full ownership of the target cluster, starting
519+
from the first instance. This includes overriding certain configuration
520+
parameters as required by EDB Postgres for Kubernetes, resetting the superuser password,
521+
creating the `streaming_replica` user, managing replicas, and more. The
522+
resulting cluster operates independently from the source instance.
452523

453524
!!! Important
454-
Configuring the network between the target instance and the source instance
455-
goes beyond the scope of EDB Postgres for Kubernetes documentation, as it depends
456-
on the actual context and environment.
525+
Configuring the network connection between the target and source instances
526+
lies outside the scope of EDB Postgres for Kubernetes documentation, as it depends heavily on
527+
the specific context and environment.
457528

458-
The streaming replication client on the target instance, which will be
459-
transparently managed by `pg_basebackup`, can authenticate itself on the source
460-
instance in any of the following ways:
529+
The streaming replication client on the target instance, managed transparently
530+
by `pg_basebackup`, can authenticate on the source instance using one of the
531+
following methods:
461532

462-
1. via [username/password](#usernamepassword-authentication)
463-
2. via [TLS client certificate](#tls-certificate-authentication)
533+
1. [Username/password](#usernamepassword-authentication)
534+
2. [TLS client certificate](#tls-certificate-authentication)
464535

465-
The latter is the recommended one if you connect to a source managed
466-
by EDB Postgres for Kubernetes or configured for TLS authentication.
467-
The first option is, however, the most common form of authentication to a
468-
PostgreSQL server in general, and might be the easiest way if the source
469-
instance is on a traditional environment outside Kubernetes.
470-
Both cases are explained below.
536+
Both authentication methods are detailed below.
471537

472538
#### Requirements
473539

@@ -545,7 +611,7 @@ file on the source PostgreSQL instance:
545611
host replication streaming_replica all md5
546612
```
547613

548-
The following manifest creates a new PostgreSQL 17.0 cluster,
614+
The following manifest creates a new PostgreSQL 17.2 cluster,
549615
called `target-db`, using the `pg_basebackup` bootstrap method
550616
to clone an external PostgreSQL cluster defined as `source-db`
551617
(in the `externalClusters` array). As you can see, the `source-db`
@@ -560,7 +626,7 @@ metadata:
560626
name: target-db
561627
spec:
562628
instances: 3
563-
imageName: quay.io/enterprisedb/postgresql:17.0
629+
imageName: quay.io/enterprisedb/postgresql:17.2
564630
565631
bootstrap:
566632
pg_basebackup:
@@ -580,7 +646,7 @@ spec:
580646
```
581647

582648
All the requirements must be met for the clone operation to work, including
583-
the same PostgreSQL version (in our case 17.0).
649+
the same PostgreSQL version (in our case 17.2).
584650

585651
#### TLS certificate authentication
586652

@@ -595,7 +661,7 @@ in the same Kubernetes cluster.
595661
This example can be easily adapted to cover an instance that resides
596662
outside the Kubernetes cluster.
597663

598-
The manifest defines a new PostgreSQL 17.0 cluster called `cluster-clone-tls`,
664+
The manifest defines a new PostgreSQL 17.2 cluster called `cluster-clone-tls`,
599665
which is bootstrapped using the `pg_basebackup` method from the `cluster-example`
600666
external cluster. The host is identified by the read/write service
601667
in the same cluster, while the `streaming_replica` user is authenticated
@@ -610,7 +676,7 @@ metadata:
610676
name: cluster-clone-tls
611677
spec:
612678
instances: 3
613-
imageName: quay.io/enterprisedb/postgresql:17.0
679+
imageName: quay.io/enterprisedb/postgresql:17.2
614680
615681
bootstrap:
616682
pg_basebackup:
@@ -691,7 +757,7 @@ instance using a second connection (see the `--wal-method=stream` option for
691757
Once the backup is completed, the new instance will be started on a new timeline
692758
and diverge from the source.
693759
For this reason, it is advised to stop all write operations to the source database
694-
before migrating to the target database in Kubernetes.
760+
before migrating to the target database.
695761

696762
!!! Important
697763
Before you attempt a migration, you must test both the procedure

product_docs/docs/postgres_for_kubernetes/1/certificates.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ Given the following files:
132132

133133
Create a secret containing the CA certificate:
134134

135-
```
135+
```sh
136136
kubectl create secret generic my-postgresql-server-ca \
137137
--from-file=ca.crt=./server-ca.crt
138138
```
139139

140140
Create a secret with the TLS certificate:
141141

142-
```
142+
```sh
143143
kubectl create secret tls my-postgresql-server \
144144
--cert=./server.crt --key=./server.key
145145
```

0 commit comments

Comments
 (0)