Skip to content

Commit a63ad49

Browse files
Jan-MFxKu
andauthored
Initial commit for new 1.6 release with Postgres 13 support. (zalando#1257)
* Initial commit for new 1.6 release with Postgres 13 support. * Updating maintainers, Go version, Codeowners. * Use lazy upgrade image that contains pg13. * fix typo for ownerReference * fix clusterrole in helm chart * reflect GCP logical backup in validation * improve PostgresTeam docs * change defaults for enable_pgversion_env_var and storage_resize_mode * explain manual part of in-place upgrade * remove gsoc docs Co-authored-by: Felix Kunde <[email protected]>
1 parent 5f3f698 commit a63ad49

30 files changed

+232
-158
lines changed

.github/workflows/run_e2e.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v1
1515
- uses: actions/setup-go@v2
1616
with:
17-
go-version: "^1.15.5"
17+
go-version: "^1.15.6"
1818
- name: Make dependencies
1919
run: make deps mocks
2020
- name: Compile

.github/workflows/run_tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v1
1515
- uses: actions/setup-go@v2
1616
with:
17-
go-version: "^1.15.5"
17+
go-version: "^1.15.6"
1818
- name: Make dependencies
1919
run: make deps mocks
2020
- name: Compile

CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# global owners
2-
* @alexeyklyukin @erthalion @sdudoladov @Jan-M @CyberDem0n @avaczi @FxKu @RafiaSabih
2+
* @erthalion @sdudoladov @Jan-M @CyberDem0n @avaczi @FxKu @RafiaSabih

MAINTAINERS

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
Oleksii Kliukin <[email protected]>
21
Dmitrii Dolgov <[email protected]>
32
Sergey Dudoladov <[email protected]>
3+
Felix Kunde <[email protected]>
4+
Jan Mussler <[email protected]>
5+
Rafia Sabih <[email protected]>

README.md

+23-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pipelines with no access to Kubernetes API directly, promoting infrastructure as
1414
### Operator features
1515

1616
* Rolling updates on Postgres cluster changes, incl. quick minor version updates
17-
* Live volume resize without pod restarts (AWS EBS, others pending)
17+
* Live volume resize without pod restarts (AWS EBS, PvC)
1818
* Database connection pooler with PGBouncer
1919
* Restore and cloning Postgres clusters (incl. major version upgrade)
2020
* Additionally logical backups to S3 bucket can be configured
@@ -23,10 +23,12 @@ pipelines with no access to Kubernetes API directly, promoting infrastructure as
2323
* Basic credential and user management on K8s, eases application deployments
2424
* UI to create and edit Postgres cluster manifests
2525
* Works well on Amazon AWS, Google Cloud, OpenShift and locally on Kind
26+
* Support for custom TLS certificates
27+
* Base support for AWS EBS gp3 migration (iops, throughput pending)
2628

2729
### PostgreSQL features
2830

29-
* Supports PostgreSQL 12, starting from 9.6+
31+
* Supports PostgreSQL 13, starting from 9.6+
3032
* Streaming replication cluster via Patroni
3133
* Point-In-Time-Recovery with
3234
[pg_basebackup](https://www.postgresql.org/docs/11/app-pgbasebackup.html) /
@@ -48,7 +50,25 @@ pipelines with no access to Kubernetes API directly, promoting infrastructure as
4850
[timescaledb](https://github.com/timescale/timescaledb)
4951

5052
The Postgres Operator has been developed at Zalando and is being used in
51-
production for over two years.
53+
production for over three years.
54+
55+
## Notes on Postgres 13 support
56+
57+
If you are new to the operator, you can skip this and just start using the Postgres operator as is, Postgres 13 is ready to go.
58+
59+
The Postgres operator supports Postgres 13 with the new Spilo Image that includes also the recent Patroni version to support PG13 settings.
60+
More work on optimizing restarts and rolling upgrades is pending.
61+
62+
If you are already using the Postgres operator in older version with a Spilo 12 Docker Image you need to be aware of the changes for the backup path.
63+
We introduce the major version into the backup path to smooth the major version upgrade that is now supported manually.
64+
65+
The new operator configuration, sets a compatilibty flag *enable_spilo_wal_path_compat* to make Spilo look in current path but also old format paths for wal segments.
66+
This comes at potential perf. costs, and should be disabled after a few days.
67+
68+
The new Spilo 13 image is: `registry.opensource.zalan.do/acid/spilo-13:2.0-p1`
69+
70+
The last Spilo 12 image is: `registry.opensource.zalan.do/acid/spilo-12:1.6-p5`
71+
5272

5373
## Getting started
5474

charts/postgres-operator/crds/operatorconfigurations.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@ spec:
319319
properties:
320320
logical_backup_docker_image:
321321
type: string
322+
logical_backup_google_application_credentials:
323+
type: string
324+
logical_backup_provider:
325+
type: string
322326
logical_backup_s3_access_key_id:
323327
type: string
324328
logical_backup_s3_bucket:

charts/postgres-operator/templates/clusterrole.yaml

+26-8
Original file line numberDiff line numberDiff line change
@@ -44,34 +44,51 @@ rules:
4444
- get
4545
- patch
4646
- update
47-
# to read configuration from ConfigMaps
47+
# to send events to the CRs
4848
- apiGroups:
4949
- ""
5050
resources:
51-
- configmaps
51+
- events
5252
verbs:
53+
- create
5354
- get
54-
# to send events to the CRs
55+
- list
56+
- patch
57+
- update
58+
- watch
59+
# to manage endpoints/configmaps which are also used by Patroni
60+
{{- if toString .Values.configGeneral.kubernetes_use_configmaps | eq "true" }}
5561
- apiGroups:
5662
- ""
5763
resources:
58-
- events
64+
- configmaps
5965
verbs:
6066
- create
67+
- delete
68+
- deletecollection
6169
- get
6270
- list
6371
- patch
6472
- update
6573
- watch
66-
# to manage endpoints/configmaps which are also used by Patroni
6774
- apiGroups:
6875
- ""
6976
resources:
70-
{{- if toString .Values.configGeneral.kubernetes_use_configmaps | eq "true" }}
71-
- configmaps
77+
- endpoints
78+
verbs:
79+
- get
7280
{{- else }}
81+
# to read configuration from ConfigMaps
82+
- apiGroups:
83+
- ""
84+
resources:
85+
- configmaps
86+
verbs:
87+
- get
88+
- apiGroups:
89+
- ""
90+
resources:
7391
- endpoints
74-
{{- end }}
7592
verbs:
7693
- create
7794
- delete
@@ -81,6 +98,7 @@ rules:
8198
- patch
8299
- update
83100
- watch
101+
{{- end }}
84102
# to CRUD secrets for database access
85103
- apiGroups:
86104
- ""

charts/postgres-operator/values-crd.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ configGeneral:
2222
# update only the statefulsets without immediately doing the rolling update
2323
enable_lazy_spilo_upgrade: false
2424
# set the PGVERSION env var instead of providing the version via postgresql.bin_dir in SPILO_CONFIGURATION
25-
enable_pgversion_env_var: false
25+
enable_pgversion_env_var: true
2626
# start any new database pod without limitations on shm memory
2727
enable_shm_volume: true
2828
# enables backwards compatible path between Spilo 12 and Spilo 13 images

charts/postgres-operator/values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ configGeneral:
2525
# update only the statefulsets without immediately doing the rolling update
2626
enable_lazy_spilo_upgrade: "false"
2727
# set the PGVERSION env var instead of providing the version via postgresql.bin_dir in SPILO_CONFIGURATION
28-
enable_pgversion_env_var: "false"
28+
enable_pgversion_env_var: "true"
2929
# start any new database pod without limitations on shm memory
3030
enable_shm_volume: "true"
3131
# enables backwards compatible path between Spilo 12 and Spilo 13 images

delivery.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pipeline:
1616
- desc: 'Install go'
1717
cmd: |
1818
cd /tmp
19-
wget -q https://storage.googleapis.com/golang/go1.15.5.linux-amd64.tar.gz -O go.tar.gz
19+
wget -q https://storage.googleapis.com/golang/go1.15.6.linux-amd64.tar.gz -O go.tar.gz
2020
tar -xf go.tar.gz
2121
mv go /usr/local
2222
ln -s /usr/local/go/bin/go /usr/bin/go

docs/administrator.md

+23-9
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,29 @@ switchover (planned failover) of the master to the Pod with new minor version.
1111
The switch should usually take less than 5 seconds, still clients have to
1212
reconnect.
1313

14-
Major version upgrades are supported either via [cloning](user.md#how-to-clone-an-existing-postgresql-cluster)or in-place.
15-
16-
With cloning, the new cluster manifest must have a higher `version` string than the source
17-
cluster and will be created from a basebackup. Depending of the cluster size,
18-
downtime in this case can be significant as writes to the database should be
19-
stopped and all WAL files should be archived first before cloning is started.
20-
21-
Starting with Spilo 13, Postgres Operator can do in-place major version upgrade, which should be faster than cloning. To trigger the upgrade, simply increase the version in the cluster manifest. As the very last step of
22-
processing the manifest update event, the operator will call the `inplace_upgrade.py` script in Spilo. The upgrade is usually fast, well under one minute for most DBs. Note the changes become irrevertible once `pg_upgrade` is called. To understand the upgrade procedure, refer to the [corresponding PR in Spilo](https://github.com/zalando/spilo/pull/488).
14+
Major version upgrades are supported either via [cloning](user.md#how-to-clone-an-existing-postgresql-cluster)
15+
or in-place.
16+
17+
With cloning, the new cluster manifest must have a higher `version` string than
18+
the source cluster and will be created from a basebackup. Depending of the
19+
cluster size, downtime in this case can be significant as writes to the database
20+
should be stopped and all WAL files should be archived first before cloning is
21+
started.
22+
23+
Starting with Spilo 13, Postgres Operator can do in-place major version upgrade,
24+
which should be faster than cloning. However, it is not fully automatic yet.
25+
First, you need to make sure, that setting the PG_VERSION environment variable
26+
is enabled in the configuration. Since `v1.6.0`, `enable_pgversion_env_var` is
27+
enabled by default.
28+
29+
To trigger the upgrade, increase the version in the cluster manifest. After
30+
Pods are rotated `configure_spilo` will notice the version mismatch and start
31+
the old version again. You can then exec into the Postgres container of the
32+
master instance and call `python3 /scripts/inplace_upgrade.py N` where `N`
33+
is the number of members of your cluster (see `number_of_instances`). The
34+
upgrade is usually fast, well under one minute for most DBs. Note, that changes
35+
become irrevertible once `pg_upgrade` is called. To understand the upgrade
36+
procedure, refer to the [corresponding PR in Spilo](https://github.com/zalando/spilo/pull/488).
2337

2438
## CRD Validation
2539

docs/developer.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ manifest files:
286286

287287
Postgres manifest parameters are defined in the [api package](../pkg/apis/acid.zalan.do/v1/postgresql_type.go).
288288
The operator behavior has to be implemented at least in [k8sres.go](../pkg/cluster/k8sres.go).
289-
Validation of CRD parameters is controlled in [crd.go](../pkg/apis/acid.zalan.do/v1/crds.go).
289+
Validation of CRD parameters is controlled in [crds.go](../pkg/apis/acid.zalan.do/v1/crds.go).
290290
Please, reflect your changes in tests, for example in:
291291
* [config_test.go](../pkg/util/config/config_test.go)
292292
* [k8sres_test.go](../pkg/cluster/k8sres_test.go)

docs/gsoc-2019/ideas.md

-63
This file was deleted.

docs/reference/operator_parameters.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Those are top-level keys, containing both leaf keys and groups.
8080
The default is `false`.
8181

8282
* **enable_pgversion_env_var**
83-
With newer versions of Spilo, it is preferable to use `PGVERSION` pod environment variable instead of the setting `postgresql.bin_dir` in the `SPILO_CONFIGURATION` env variable. When this option is true, the operator sets `PGVERSION` and omits `postgresql.bin_dir` from `SPILO_CONFIGURATION`. When false, the `postgresql.bin_dir` is set. This setting takes precedence over `PGVERSION`; see PR 222 in Spilo. The default is `false`.
83+
With newer versions of Spilo, it is preferable to use `PGVERSION` pod environment variable instead of the setting `postgresql.bin_dir` in the `SPILO_CONFIGURATION` env variable. When this option is true, the operator sets `PGVERSION` and omits `postgresql.bin_dir` from `SPILO_CONFIGURATION`. When false, the `postgresql.bin_dir` is set. This setting takes precedence over `PGVERSION`; see PR 222 in Spilo. The default is `true`.
8484

8585
* **enable_spilo_wal_path_compat**
8686
enables backwards compatible path between Spilo 12 and Spilo 13 images. The default is `false`.
@@ -375,7 +375,7 @@ configuration they are grouped under the `kubernetes` key.
375375
* **storage_resize_mode**
376376
defines how operator handels the difference between requested volume size and
377377
actual size. Available options are: ebs - tries to resize EBS volume, pvc -
378-
changes PVC definition, off - disables resize of the volumes. Default is "ebs".
378+
changes PVC definition, off - disables resize of the volumes. Default is "pvc".
379379
When using OpenShift please use one of the other available options.
380380

381381
## Kubernetes resource requests

0 commit comments

Comments
 (0)