Skip to content

Commit a5663da

Browse files
jopadiFxKu
andauthored
add the pg version 16 (zalando#2557)
* add the pg version 16 * add comma after pg16 in crds api * change minimal_major_version to 12 * add new spilo image for pg16 * edit the registry from current and lazy spilo * Update e2e/run.sh Co-authored-by: Felix Kunde <[email protected]> * Update README.md Co-authored-by: Felix Kunde <[email protected]> * add pg 11 to be compatible for the existing DBs * update pq, pyyaml,k8s and kind version * skip test_infrastructure_roles * skip another test * remove the skipping * adjust the verification of new Patroni version states --------- Co-authored-by: Felix Kunde <[email protected]>
1 parent 8bd9080 commit a5663da

34 files changed

+79
-88
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ pipelines with no access to Kubernetes API directly, promoting infrastructure as
2929

3030
### PostgreSQL features
3131

32-
* Supports PostgreSQL 15, starting from 10+
32+
* Supports PostgreSQL 16, starting from 11+
3333
* Streaming replication cluster via Patroni
3434
* Point-In-Time-Recovery with
35-
[pg_basebackup](https://www.postgresql.org/docs/11/app-pgbasebackup.html) /
35+
[pg_basebackup](https://www.postgresql.org/docs/16/app-pgbasebackup.html) /
3636
[WAL-E](https://github.com/wal-e/wal-e) via [Spilo](https://github.com/zalando/spilo)
3737
* Preload libraries: [bg_mon](https://github.com/CyberDem0n/bg_mon),
38-
[pg_stat_statements](https://www.postgresql.org/docs/15/pgstatstatements.html),
38+
[pg_stat_statements](https://www.postgresql.org/docs/16/pgstatstatements.html),
3939
[pgextwlist](https://github.com/dimitri/pgextwlist),
4040
[pg_auth_mon](https://github.com/RafiaSabih/pg_auth_mon)
4141
* Incl. popular Postgres extensions such as

charts/postgres-operator-ui/templates/deployment.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ spec:
8888
"15",
8989
"14",
9090
"13",
91-
"12",
92-
"11"
91+
"12"
9392
]
9493
}
9594
{{- if .Values.extraEnvs }}

charts/postgres-operator/crds/operatorconfigurations.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ spec:
6868
type: string
6969
docker_image:
7070
type: string
71-
default: "ghcr.io/zalando/spilo-15:3.0-p1"
71+
default: "ghcr.io/zalando/spilo-16:3.2-p2"
7272
enable_crd_registration:
7373
type: boolean
7474
default: true
@@ -167,10 +167,10 @@ spec:
167167
type: string
168168
minimal_major_version:
169169
type: string
170-
default: "11"
170+
default: "12"
171171
target_major_version:
172172
type: string
173-
default: "15"
173+
default: "16"
174174
kubernetes:
175175
type: object
176176
properties:

charts/postgres-operator/crds/postgresqls.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,12 @@ spec:
371371
version:
372372
type: string
373373
enum:
374-
- "10"
375374
- "11"
376375
- "12"
377376
- "13"
378377
- "14"
379378
- "15"
379+
- "16"
380380
parameters:
381381
type: object
382382
additionalProperties:

charts/postgres-operator/values.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ configGeneral:
3838
# etcd connection string for Patroni. Empty uses K8s-native DCS.
3939
etcd_host: ""
4040
# Spilo docker image
41-
docker_image: ghcr.io/zalando/spilo-15:3.0-p1
41+
docker_image: ghcr.io/zalando/spilo-16:3.2-p2
4242

4343
# key name for annotation to ignore globally configured instance limits
4444
# ignore_instance_limits_annotation_key: ""
@@ -89,9 +89,9 @@ configMajorVersionUpgrade:
8989
# - acid
9090

9191
# minimal Postgres major version that will not automatically be upgraded
92-
minimal_major_version: "11"
92+
minimal_major_version: "12"
9393
# target Postgres major version when upgrading clusters automatically
94-
target_major_version: "15"
94+
target_major_version: "16"
9595

9696
configKubernetes:
9797
# list of additional capabilities for postgres container

docker/logical-backup/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ RUN apt-get update \
3030
postgresql-client-14 \
3131
postgresql-client-13 \
3232
postgresql-client-12 \
33-
postgresql-client-11 \
3433
&& apt-get clean \
3534
&& rm -rf /var/lib/apt/lists/*
3635

docs/administrator.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,7 @@ aws_or_gcp:
12171217

12181218
If cluster members have to be (re)initialized restoring physical backups
12191219
happens automatically either from the backup location or by running
1220-
[pg_basebackup](https://www.postgresql.org/docs/15/app-pgbasebackup.html)
1220+
[pg_basebackup](https://www.postgresql.org/docs/16/app-pgbasebackup.html)
12211221
on one of the other running instances (preferably replicas if they do not lag
12221222
behind). You can test restoring backups by [cloning](user.md#how-to-clone-an-existing-postgresql-cluster)
12231223
clusters.

docs/reference/cluster_manifest.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ the global configuration before adding the `tls` section'.
621621
## Change data capture streams
622622

623623
This sections enables change data capture (CDC) streams via Postgres'
624-
[logical decoding](https://www.postgresql.org/docs/15/logicaldecoding.html)
624+
[logical decoding](https://www.postgresql.org/docs/16/logicaldecoding.html)
625625
feature and `pgoutput` plugin. While the Postgres operator takes responsibility
626626
for providing the setup to publish change events, it relies on external tools
627627
to consume them. At Zalando, we are using a workflow based on
@@ -653,7 +653,7 @@ can have the following properties:
653653
and `payloadColumn`). The CDC operator is following the [outbox pattern](https://debezium.io/blog/2019/02/19/reliable-microservices-data-exchange-with-the-outbox-pattern/).
654654
The application is responsible for putting events into a (JSON/B or VARCHAR)
655655
payload column of the outbox table in the structure of the specified target
656-
event type. The operator will create a [PUBLICATION](https://www.postgresql.org/docs/15/logical-replication-publication.html)
656+
event type. The operator will create a [PUBLICATION](https://www.postgresql.org/docs/16/logical-replication-publication.html)
657657
in Postgres for all tables specified for one `database` and `applicationId`.
658658
The CDC operator will consume from it shortly after transactions are
659659
committed to the outbox table. The `idColumn` will be used in telemetry for

docs/reference/operator_parameters.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,12 @@ CRD-configuration, they are grouped under the `major_version_upgrade` key.
250250

251251
* **minimal_major_version**
252252
The minimal Postgres major version that will not automatically be upgraded
253-
when `major_version_upgrade_mode` is set to `"full"`. The default is `"11"`.
253+
when `major_version_upgrade_mode` is set to `"full"`. The default is `"12"`.
254254

255255
* **target_major_version**
256256
The target Postgres major version when upgrading clusters automatically
257257
which violate the configured allowed `minimal_major_version` when
258-
`major_version_upgrade_mode` is set to `"full"`. The default is `"15"`.
258+
`major_version_upgrade_mode` is set to `"full"`. The default is `"16"`.
259259

260260
## Kubernetes resources
261261

docs/user.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ spec:
3030
databases:
3131
foo: zalando
3232
postgresql:
33-
version: "15"
33+
version: "16"
3434
```
3535
3636
Once you cloned the Postgres Operator [repository](https://github.com/zalando/postgres-operator)
@@ -109,7 +109,7 @@ metadata:
109109
spec:
110110
[...]
111111
postgresql:
112-
version: "15"
112+
version: "16"
113113
parameters:
114114
password_encryption: scram-sha-256
115115
```
@@ -517,7 +517,7 @@ Postgres Operator will create the following NOLOGIN roles:
517517

518518
The `<dbname>_owner` role is the database owner and should be used when creating
519519
new database objects. All members of the `admin` role, e.g. teams API roles, can
520-
become the owner with the `SET ROLE` command. [Default privileges](https://www.postgresql.org/docs/15/sql-alterdefaultprivileges.html)
520+
become the owner with the `SET ROLE` command. [Default privileges](https://www.postgresql.org/docs/16/sql-alterdefaultprivileges.html)
521521
are configured for the owner role so that the `<dbname>_reader` role
522522
automatically gets read-access (SELECT) to new tables and sequences and the
523523
`<dbname>_writer` receives write-access (INSERT, UPDATE, DELETE on tables,
@@ -594,7 +594,7 @@ spec:
594594

595595
### Schema `search_path` for default roles
596596

597-
The schema [`search_path`](https://www.postgresql.org/docs/15/ddl-schemas.html#DDL-SCHEMAS-PATH)
597+
The schema [`search_path`](https://www.postgresql.org/docs/16/ddl-schemas.html#DDL-SCHEMAS-PATH)
598598
for each role will include the role name and the schemas, this role should have
599599
access to. So `foo_bar_writer` does not have to schema-qualify tables from
600600
schemas `foo_bar_writer, bar`, while `foo_writer` can look up `foo_writer` and
@@ -695,7 +695,7 @@ handle it.
695695

696696
### HugePages support
697697

698-
The operator supports [HugePages](https://www.postgresql.org/docs/15/kernel-resources.html#LINUX-HUGEPAGES).
698+
The operator supports [HugePages](https://www.postgresql.org/docs/16/kernel-resources.html#LINUX-HUGEPAGES).
699699
To enable HugePages, set the matching resource requests and/or limits in the manifest:
700700

701701
```yaml
@@ -758,7 +758,7 @@ If you need to define a `nodeAffinity` for all your Postgres clusters use the
758758
## In-place major version upgrade
759759

760760
Starting with Spilo 13, operator supports in-place major version upgrade to a
761-
higher major version (e.g. from PG 10 to PG 13). To trigger the upgrade,
761+
higher major version (e.g. from PG 11 to PG 13). To trigger the upgrade,
762762
simply increase the version in the manifest. It is your responsibility to test
763763
your applications against the new version before the upgrade; downgrading is
764764
not supported. The easiest way to do so is to try the upgrade on the cloned
@@ -838,7 +838,7 @@ spec:
838838
### Clone directly
839839

840840
Another way to get a fresh copy of your source DB cluster is via
841-
[pg_basebackup](https://www.postgresql.org/docs/15/app-pgbasebackup.html). To
841+
[pg_basebackup](https://www.postgresql.org/docs/16/app-pgbasebackup.html). To
842842
use this feature simply leave out the timestamp field from the clone section.
843843
The operator will connect to the service of the source cluster by name. If the
844844
cluster is called test, then the connection string will look like host=test

e2e/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ tools:
4646
# install pinned version of 'kind'
4747
# go install must run outside of a dir with a (module-based) Go project !
4848
# otherwise go install updates project's dependencies and/or behaves differently
49-
cd "/tmp" && GO111MODULE=on go install sigs.k8s.io/kind@v0.14.0
49+
cd "/tmp" && GO111MODULE=on go install sigs.k8s.io/kind@v0.22.0
5050

5151
e2etest: tools copy clean
5252
./run.sh main

e2e/requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
kubernetes==24.2.0
1+
kubernetes==29.2.0
22
timeout_decorator==0.5.0
3-
pyyaml==6.0
3+
pyyaml==6.0.1

e2e/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ IFS=$'\n\t'
88

99
readonly cluster_name="postgres-operator-e2e-tests"
1010
readonly kubeconfig_path="/tmp/kind-config-${cluster_name}"
11-
readonly spilo_image="registry.opensource.zalan.do/acid/spilo-15-e2e:0.1"
11+
readonly spilo_image="registry.opensource.zalan.do/acid/spilo-16-e2e:0.1"
1212
readonly e2e_test_runner_image="registry.opensource.zalan.do/acid/postgres-operator-e2e-tests-runner:0.4"
1313

1414
export GOPATH=${GOPATH-~/go}

e2e/tests/k8s_api.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def get_operator_state(self):
314314

315315
def get_patroni_running_members(self, pod="acid-minimal-cluster-0"):
316316
result = self.get_patroni_state(pod)
317-
return list(filter(lambda x: "State" in x and x["State"] == "running", result))
317+
return list(filter(lambda x: "State" in x and x["State"] in ["running", "streaming"], result))
318318

319319
def get_deployment_replica_count(self, name="acid-minimal-cluster-pooler", namespace="default"):
320320
try:
@@ -583,7 +583,7 @@ def get_patroni_state(self, pod):
583583

584584
def get_patroni_running_members(self, pod):
585585
result = self.get_patroni_state(pod)
586-
return list(filter(lambda x: x["State"] == "running", result))
586+
return list(filter(lambda x: x["State"] in ["running", "streaming"], result))
587587

588588
def get_statefulset_image(self, label_selector="application=spilo,cluster-name=acid-minimal-cluster", namespace='default'):
589589
ssets = self.api.apps_v1.list_namespaced_stateful_set(namespace, label_selector=label_selector, limit=1)

e2e/tests/test_e2e.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
from tests.k8s_api import K8s
1313
from kubernetes.client.rest import ApiException
1414

15-
SPILO_CURRENT = "registry.opensource.zalan.do/acid/spilo-15-e2e:0.1"
16-
SPILO_LAZY = "registry.opensource.zalan.do/acid/spilo-15-e2e:0.2"
15+
SPILO_CURRENT = "registry.opensource.zalan.do/acid/spilo-16-e2e:0.1"
16+
SPILO_LAZY = "registry.opensource.zalan.do/acid/spilo-16-e2e:0.2"
1717

1818

1919
def to_selector(labels):

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.19
55
require (
66
github.com/aws/aws-sdk-go v1.42.18
77
github.com/golang/mock v1.6.0
8-
github.com/lib/pq v1.10.4
8+
github.com/lib/pq v1.10.9
99
github.com/motomux/pretty v0.0.0-20161209205251-b2aad2c9a95d
1010
github.com/pkg/errors v0.9.1
1111
github.com/r3labs/diff v1.1.0

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
6363
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
6464
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
6565
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
66-
github.com/lib/pq v1.10.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk=
67-
github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
66+
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
67+
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
6868
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
6969
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
7070
github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8=

manifests/complete-postgres-manifest.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ metadata:
1010
# "delete-date": "2020-08-31" # can only be deleted on that day if "delete-date "key is configured
1111
# "delete-clustername": "acid-test-cluster" # can only be deleted when name matches if "delete-clustername" key is configured
1212
spec:
13-
dockerImage: ghcr.io/zalando/spilo-15:3.0-p1
13+
dockerImage: ghcr.io/zalando/spilo-16:3.2-p2
1414
teamId: "acid"
1515
numberOfInstances: 2
1616
users: # Application/Robot users
@@ -48,7 +48,7 @@ spec:
4848
defaultRoles: true
4949
defaultUsers: false
5050
postgresql:
51-
version: "15"
51+
version: "16"
5252
parameters: # Expert section
5353
shared_buffers: "32MB"
5454
max_connections: "10"

manifests/configmap.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ data:
3434
default_memory_request: 100Mi
3535
# delete_annotation_date_key: delete-date
3636
# delete_annotation_name_key: delete-clustername
37-
docker_image: ghcr.io/zalando/spilo-15:3.0-p1
37+
docker_image: ghcr.io/zalando/spilo-16:3.2-p2
3838
# downscaler_annotations: "deployment-time,downscaler/*"
3939
# enable_admin_role_for_users: "true"
4040
# enable_crd_registration: "true"
@@ -107,7 +107,7 @@ data:
107107
# max_memory_request: 4Gi
108108
# min_cpu_limit: 250m
109109
# min_memory_limit: 250Mi
110-
# minimal_major_version: "11"
110+
# minimal_major_version: "12"
111111
# node_readiness_label: "status:ready"
112112
# node_readiness_label_merge: "OR"
113113
# oauth_token_secret_name: postgresql-operator
@@ -157,7 +157,7 @@ data:
157157
spilo_privileged: "false"
158158
storage_resize_mode: "pvc"
159159
super_username: postgres
160-
# target_major_version: "15"
160+
# target_major_version: "16"
161161
# team_admin_role: "admin"
162162
# team_api_role_configuration: "log_statement:all"
163163
# teams_api_url: http://fake-teams-api.default.svc.cluster.local

manifests/minimal-postgres-manifest.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ spec:
1717
preparedDatabases:
1818
bar: {}
1919
postgresql:
20-
version: "15"
20+
version: "16"

manifests/operatorconfiguration.crd.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ spec:
6666
type: string
6767
docker_image:
6868
type: string
69-
default: "ghcr.io/zalando/spilo-15:3.0-p1"
69+
default: "ghcr.io/zalando/spilo-16:3.2-p2"
7070
enable_crd_registration:
7171
type: boolean
7272
default: true
@@ -165,10 +165,10 @@ spec:
165165
type: string
166166
minimal_major_version:
167167
type: string
168-
default: "11"
168+
default: "12"
169169
target_major_version:
170170
type: string
171-
default: "15"
171+
default: "16"
172172
kubernetes:
173173
type: object
174174
properties:

manifests/postgresql-operator-default-configuration.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: OperatorConfiguration
33
metadata:
44
name: postgresql-operator-default-configuration
55
configuration:
6-
docker_image: ghcr.io/zalando/spilo-15:3.0-p1
6+
docker_image: ghcr.io/zalando/spilo-16:3.2-p2
77
# enable_crd_registration: true
88
# crd_categories:
99
# - all
@@ -39,8 +39,8 @@ configuration:
3939
major_version_upgrade_mode: "off"
4040
# major_version_upgrade_team_allow_list:
4141
# - acid
42-
minimal_major_version: "11"
43-
target_major_version: "15"
42+
minimal_major_version: "12"
43+
target_major_version: "16"
4444
kubernetes:
4545
# additional_pod_capabilities:
4646
# - "SYS_NICE"

manifests/postgresql.crd.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ spec:
369369
version:
370370
type: string
371371
enum:
372-
- "10"
373372
- "11"
374373
- "12"
375374
- "13"

manifests/standby-manifest.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ spec:
88
size: 1Gi
99
numberOfInstances: 1
1010
postgresql:
11-
version: "15"
11+
version: "16"
1212
# Make this a standby cluster and provide either the s3 bucket path of source cluster or the remote primary host for continuous streaming.
1313
standby:
1414
# s3_wal_path: "s3://mybucket/spilo/acid-minimal-cluster/abcd1234-2a4b-4b2a-8c9c-c1234defg567/wal/14/"

pkg/apis/acid.zalan.do/v1/crds.go

-3
Original file line numberDiff line numberDiff line change
@@ -589,9 +589,6 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{
589589
"version": {
590590
Type: "string",
591591
Enum: []apiextv1.JSON{
592-
{
593-
Raw: []byte(`"10"`),
594-
},
595592
{
596593
Raw: []byte(`"11"`),
597594
},

0 commit comments

Comments
 (0)