Skip to content

Commit

Permalink
K8SPG-597 Release 2.4.0 (#828)
Browse files Browse the repository at this point in the history
* K8SPG-597 Update images and versions for 2.4.0 release (#819)

* K8SPG-597 Update images and versions for 2.4.0 release

* supply minor tag versions

* update the image in upgrade.yaml

* K8SPG-600: Fix failed backup status (#820)

* Fix failed backup status

* fix lint

* fix fmt

* fix regression and status update

* K8SPG-518: Fix WAL archiving on Openshift (#823)

* K8SPG-597 Fixing test case upgrade-minor to work with postures images which have minor numbers in the image name (#821)

* We now have env var PG_VER so no need to calculate the version from the image name, also, the calculation was buggy when the version contains a dot and a minor number, e.g. 16.3

* Refactor upgrade-cluster.yaml to use PG_VER environment variable instead of calculating version from image name

* K8SPG-597 - Update monitoring test (#824)

* K8SPG-254: Fix major upgrade on Openshift (#826)

---------

Co-authored-by: Andrii Dema <[email protected]>
Co-authored-by: Ege Güneş <[email protected]>
Co-authored-by: Tomislav Plavcic <[email protected]>
Co-authored-by: Viacheslav Sarzhan <[email protected]>
  • Loading branch information
5 people authored Jun 28, 2024
1 parent 9fec71b commit 21753fa
Show file tree
Hide file tree
Showing 14 changed files with 67 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ check-envtest: get-pgmonitor
$(GO_TEST) -count=1 -cover -tags=envtest ./...

# The "PGO_TEST_TIMEOUT_SCALE" environment variable (default: 1) can be set to a
# positive number that extends test timeouts. The following runs tests with
# positive number that extends test timeouts. The following runs tests with
# timeouts that are 20% longer than normal:
# make check-envtest-existing PGO_TEST_TIMEOUT_SCALE=1.2
.PHONY: check-envtest-existing
Expand Down
4 changes: 2 additions & 2 deletions config/bundle/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ resources:
- ../manager/namespace
images:
- name: postgres-operator
newName: perconalab/percona-postgresql-operator
newTag: main
newName: percona/percona-postgresql-operator
newTag: 2.4.0
4 changes: 2 additions & 2 deletions config/cw-bundle/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ resources:

images:
- name: postgres-operator
newName: perconalab/percona-postgresql-operator
newTag: main
newName: percona/percona-postgresql-operator
newTag: 2.4.0
4 changes: 2 additions & 2 deletions config/manager/cluster/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ patchesStrategicMerge:

images:
- name: postgres-operator
newName: perconalab/percona-postgresql-operator
newTag: main
newName: percona/percona-postgresql-operator
newTag: 2.4.0
4 changes: 2 additions & 2 deletions config/manager/namespace/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ patchesStrategicMerge:

images:
- name: postgres-operator
newName: perconalab/percona-postgresql-operator
newTag: main
newName: percona/percona-postgresql-operator
newTag: 2.4.0
2 changes: 1 addition & 1 deletion deploy/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45433,7 +45433,7 @@ spec:
value: INFO
- name: DISABLE_TELEMETRY
value: "false"
image: perconalab/percona-postgresql-operator:main
image: percona/percona-postgresql-operator:2.4.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
Expand Down
8 changes: 4 additions & 4 deletions deploy/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ spec:
# test-label: value


image: perconalab/percona-postgresql-operator:main-ppg16-postgres
image: percona/percona-postgresql-operator:2.4.0-ppg16.3-postgres
imagePullPolicy: Always
postgresVersion: 16
# port: 5432
Expand Down Expand Up @@ -219,7 +219,7 @@ spec:
proxy:
pgBouncer:
replicas: 3
image: perconalab/percona-postgresql-operator:main-ppg16-pgbouncer
image: percona/percona-postgresql-operator:2.4.0-ppg16.3-pgbouncer1.22.1
# exposeSuperusers: true
# resources:
# limits:
Expand Down Expand Up @@ -300,7 +300,7 @@ spec:
pgbackrest:
# metadata:
# labels:
image: perconalab/percona-postgresql-operator:main-ppg16-pgbackrest
image: percona/percona-postgresql-operator:2.4.0-ppg16.3-pgbackrest2.51-1
#
# containers:
# pgbackrest:
Expand Down Expand Up @@ -443,7 +443,7 @@ spec:

pmm:
enabled: false
image: percona/pmm-client:2.41.0
image: percona/pmm-client:2.42.0
# imagePullPolicy: IfNotPresent
secret: cluster1-pmm-secret
serverHost: monitoring-service
Expand Down
2 changes: 1 addition & 1 deletion deploy/cw-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45431,7 +45431,7 @@ spec:
value: INFO
- name: DISABLE_TELEMETRY
value: "false"
image: perconalab/percona-postgresql-operator:main
image: percona/percona-postgresql-operator:2.4.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
Expand Down
2 changes: 1 addition & 1 deletion deploy/cw-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
value: INFO
- name: DISABLE_TELEMETRY
value: "false"
image: perconalab/percona-postgresql-operator:main
image: percona/percona-postgresql-operator:2.4.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
Expand Down
2 changes: 1 addition & 1 deletion deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
value: INFO
- name: DISABLE_TELEMETRY
value: "false"
image: perconalab/percona-postgresql-operator:main
image: percona/percona-postgresql-operator:2.4.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
Expand Down
2 changes: 1 addition & 1 deletion deploy/upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ metadata:
name: cluster1-15-to-16
spec:
postgresClusterName: cluster1
image: perconalab/percona-postgresql-operator:main-upgrade
image: percona/percona-postgresql-operator:2.4.0-upgrade
fromPostgresVersion: 15
toPostgresVersion: 16
47 changes: 38 additions & 9 deletions e2e-tests/tests/monitoring/04-assert.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
apiVersion: pgv2.percona.com/v2
kind: PerconaPGCluster
metadata:
labels:
e2e: monitoring
name: monitoring
status:
pgbouncer:
ready: 3
size: 3
postgres:
instances:
- name: instance1
ready: 3
size: 3
ready: 3
size: 3
state: ready
---
apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
Expand All @@ -14,6 +32,26 @@ status:
replicas: 3
updatedReplicas: 3
---
kind: StatefulSet
apiVersion: apps/v1
metadata:
labels:
postgres-operator.crunchydata.com/cluster: monitoring
postgres-operator.crunchydata.com/data: postgres
postgres-operator.crunchydata.com/instance-set: instance1
ownerReferences:
- apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
name: monitoring
controller: true
blockOwnerDeletion: true
status:
observedGeneration: 3
replicas: 1
readyReplicas: 1
updatedReplicas: 1
collisionCount: 0
---
kind: Pod
apiVersion: v1
metadata:
Expand All @@ -27,12 +65,3 @@ metadata:
kind: StatefulSet
status:
phase: Running
conditions:
- type: Initialized
status: 'True'
- type: Ready
status: 'True'
- type: ContainersReady
status: 'True'
- type: PodScheduled
status: 'True'
14 changes: 7 additions & 7 deletions e2e-tests/tests/upgrade-minor/01-create-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@ commands:
curl -s "https://raw.githubusercontent.com/percona/percona-postgresql-operator/v${lower_ver}/deploy/cr.yaml" >"${TEMP_DIR}/cr_lower.yaml"
# get PG version which we want to test
pg_ver=$(echo "$IMAGE_POSTGRESQL" | cut -d':' -f2 | grep -oE '\-ppg[0-9]+-' | grep -oE '[0-9]+' | tr -d '-')
pg_ver=$PG_VER
pg_exists=0
pg_exists=$(curl -s https://check.percona.com/versions/v1/pg-operator/${lower_ver} | jq '.versions[].matrix.postgresql | with_entries(select(.key | startswith("'${pg_ver}'"))) | length')
pg_exists=$(curl -s https://check.percona.com/versions/v1/pg-operator/${lower_ver} | jq '.versions[].matrix.postgresql | with_entries(select(.key | startswith("'$pg_ver'"))) | length')
# if the lower version of operator doesn't have new PG version we will use lower PG version
# but in that case not the intended targer PG database image will be tested
# (this should happen once a year on major PG version release, but only for this latest version)
if [ $pg_exists -eq 0 ]; then
pg_ver=$((pg_ver - 1))
fi
echo "${pg_ver}" >"${TEMP_DIR}/pg_ver.txt"
echo $pg_ver >"${TEMP_DIR}/pg_ver.txt"
yq -i eval '
.metadata.name = "'${test_name}'" |
.metadata.labels = {"e2e":"'${test_name}'"} |
.spec.image = "percona/percona-postgresql-operator:'${lower_ver}'-ppg'${pg_ver}'-postgres" |
.spec.postgresVersion = '${pg_ver}' |
.spec.proxy.pgBouncer.image = "percona/percona-postgresql-operator:'${lower_ver}'-ppg'${pg_ver}'-pgbouncer" |
.spec.image = "percona/percona-postgresql-operator:'${lower_ver}'-ppg'$pg_ver'-postgres" |
.spec.postgresVersion = '$pg_ver' |
.spec.proxy.pgBouncer.image = "percona/percona-postgresql-operator:'${lower_ver}'-ppg'$pg_ver'-pgbouncer" |
.spec.backups.pgbackrest.repos[0].schedules = null |
.spec.backups.pgbackrest.image = "percona/percona-postgresql-operator:'${lower_ver}'-ppg'${pg_ver}'-pgbackrest" |
.spec.backups.pgbackrest.image = "percona/percona-postgresql-operator:'${lower_ver}'-ppg'$pg_ver'-pgbackrest" |
.spec.users += [{"name":"postgres","password":{"type":"AlphaNumeric"}}] |
.spec.users += [{"name":"'${test_name}'","password":{"type":"AlphaNumeric"}}]' "${TEMP_DIR}/cr_lower.yaml"
kubectl -n "${NAMESPACE}" apply -f "${TEMP_DIR}/cr_lower.yaml"
9 changes: 4 additions & 5 deletions e2e-tests/tests/upgrade-minor/05-upgrade-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ commands:
source ../../functions
pg_ver_lower="$(cat ${TEMP_DIR}/pg_ver.txt)"
pg_ver_upper=$(echo "$IMAGE_POSTGRESQL" | cut -d':' -f2 | grep -oE '\-ppg[0-9]+-' | grep -oE '[0-9]+' | tr -d '-')
target_image_postgresql=$IMAGE_POSTGRESQL
target_image_pgbouncer=$IMAGE_PGBOUNCER
target_image_backrest=$IMAGE_BACKREST
if [ "${pg_ver_lower}" != "${pg_ver_upper}" ]; then
target_image_postgresql="perconalab/percona-postgresql-operator:main-ppg${pg_ver_lower}-postgres"
target_image_pgbouncer="perconalab/percona-postgresql-operator:main-ppg${pg_ver_lower}-pgbouncer"
target_image_backrest="perconalab/percona-postgresql-operator:main-ppg${pg_ver_lower}-pgbackrest"
if [ "$pg_ver_lower" != "$PG_VER" ]; then
target_image_postgresql="perconalab/percona-postgresql-operator:main-ppg$pg_ver_lower-postgres"
target_image_pgbouncer="perconalab/percona-postgresql-operator:main-ppg$pg_ver_lower-pgbouncer"
target_image_backrest="perconalab/percona-postgresql-operator:main-ppg$pg_ver_lower-pgbackrest"
fi
cr_ver=$(yq '.spec.crVersion' $DEPLOY_DIR/cr.yaml)
Expand Down

0 comments on commit 21753fa

Please sign in to comment.