Skip to content

Commit dd09eac

Browse files
committed
Merge branch '2025-01-14-update-base-images' into 'main-1.15'
🚆 Merge Train for #2953, #2962, #2963 See merge request ongresinc/stackgres!1643
2 parents 6df79ea + fbc74b9 commit dd09eac

59 files changed

Lines changed: 1332 additions & 862 deletions

File tree

Some content is hidden

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

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
image: null
22

33
variables:
4-
SG_CI_IMAGE_NAME: "ci:1.30"
4+
SG_CI_IMAGE_NAME: "ci:1.31"
55
BUILDER_IMAGE_NAME: "builder:1.9"
66
SKIP_NATIVE: "false"
77
SKIP_E2E: "false"

stackgres-k8s/ci/build/Dockerfile-ci

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,6 @@ FROM registry.access.redhat.com/ubi8-minimal:8.10-1018
156156
RUN chmod a+x /bin/operator-sdk-1.32
157157
RUN wget -O /bin/kind-0.25.0 "https://github.com/kubernetes-sigs/kind/releases/download/v0.25.0/kind-linux-$(uname -m | grep -qxF aarch64 && echo arm64 || echo amd64)"
158158
RUN chmod a+x /bin/kind-0.25.0
159+
RUN wget -O /bin/kind-0.26.0 "https://github.com/kubernetes-sigs/kind/releases/download/v0.26.0/kind-linux-$(uname -m | grep -qxF aarch64 && echo arm64 || echo amd64)"
160+
RUN chmod a+x /bin/kind-0.26.0
159161

stackgres-k8s/ci/build/config.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
.images:
2-
ci_image: &ci_image registry.gitlab.com/ongresinc/stackgres/ci:1.30
2+
ci_image: &ci_image registry.gitlab.com/ongresinc/stackgres/ci:1.31
33
jdk_build_image: &jdk_build_image registry.gitlab.com/ongresinc/stackgres/builder:1.9
44
jdk_runtime_image: &jdk_runtime_image registry.access.redhat.com/ubi9/openjdk-21:1.21-3
5-
ubi8_micro_image: &ubi8_micro_image registry.access.redhat.com/ubi8-micro:8.10-15
6-
ubi9_minimal_image: &ubi9_minimal_image registry.access.redhat.com/ubi9-minimal:9.5-1731593028
7-
admin_ui_build_image: &admin_ui_build_image registry.access.redhat.com/ubi8/nodejs-20:1-69.1731463535
8-
admin_ui_nginx_image: &admin_ui_nginx_image registry.access.redhat.com/ubi8/nginx-124:1-35.1731463551
9-
pglambda_nodejs_image: &pglambda_nodejs_image registry.access.redhat.com/ubi8/nodejs-18:1-133.1731463548
5+
ubi8_micro_image: &ubi8_micro_image registry.access.redhat.com/ubi8-micro:8.10-19
6+
ubi9_minimal_image: &ubi9_minimal_image registry.access.redhat.com/ubi9-minimal:9.5-1736404155
7+
admin_ui_build_image: &admin_ui_build_image registry.access.redhat.com/ubi8/nodejs-20:1-71.1736298170
8+
admin_ui_nginx_image: &admin_ui_nginx_image registry.access.redhat.com/ubi8/nginx-124:1-37.1735831629
9+
pglambda_nodejs_image: &pglambda_nodejs_image registry.access.redhat.com/ubi8/nodejs-18:1-135.1736298172
1010
platforms:
1111
- linux/x86_64
1212
- linux/aarch64

stackgres-k8s/e2e/envs/kind

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,19 @@ KIND_0_15_0="${KIND_0_15_0:-kind-0.15.0}"
1212
KIND_0_20_0="${KIND_0_20_0:-kind-0.20.0}"
1313
KIND_0_23_0="${KIND_0_23_0:-kind-0.23.0}"
1414
KIND_0_25_0="${KIND_0_25_0:-kind-0.25.0}"
15+
KIND_0_26_0="${KIND_0_26_0:-kind-0.26.0}"
1516

1617
check_kind_version() {
1718
if [ "$(echo "$K8S_VERSION" | tr . '\n' | head -n 2 | xargs -I @ printf '%05d' @)" \
19+
-ge "$(echo "1.29" | tr . '\n' | xargs -I @ printf '%05d' @)" ]
20+
then
21+
KIND="$KIND_0_26_0"
22+
if ! "$KIND" version | grep -q -F 'kind v0.26.0 '
23+
then
24+
echo "To run Kubernetes 1.29+ kind v0.26.0 is required"
25+
return 1
26+
fi
27+
elif [ "$(echo "$K8S_VERSION" | tr . '\n' | head -n 2 | xargs -I @ printf '%05d' @)" \
1828
-ge "$(echo "1.26" | tr . '\n' | xargs -I @ printf '%05d' @)" ]
1929
then
2030
KIND="$KIND_0_25_0"
@@ -178,7 +188,9 @@ apiVersion: kind.x-k8s.io/v1alpha4
178188
featureGates:
179189
$(
180190
if [ "$(echo "$K8S_VERSION" | tr . '\n' | head -n 2 | xargs -I @ printf '%05d' @)" \
181-
-ge "$(echo "1.20" | tr . '\n' | xargs -I @ printf '%05d' @)" ]
191+
-ge "$(echo "1.20" | tr . '\n' | xargs -I @ printf '%05d' @)" ] \
192+
&& [ "$(echo "$K8S_VERSION" | tr . '\n' | head -n 2 | xargs -I @ printf '%05d' @)" \
193+
-lt "$(echo "1.32" | tr . '\n' | xargs -I @ printf '%05d' @)" ]
182194
then
183195
cat << INNER_INNER_EOF
184196
HPAContainerMetrics: true
@@ -452,7 +464,8 @@ EOF
452464
CSI_DRIVER_HOST_PATH_PATH="$TARGET_PATH/csi-driver-host-path/deploy/kubernetes-1.22"
453465
elif [ "$(printf %s "$K8S_VERSION" | cut -d . -f 1-2)" = 1.29 ] \
454466
|| [ "$(printf %s "$K8S_VERSION" | cut -d . -f 1-2)" = 1.30 ] \
455-
|| [ "$(printf %s "$K8S_VERSION" | cut -d . -f 1-2)" = 1.31 ]
467+
|| [ "$(printf %s "$K8S_VERSION" | cut -d . -f 1-2)" = 1.31 ] \
468+
|| [ "$(printf %s "$K8S_VERSION" | cut -d . -f 1-2)" = 1.32 ]
456469
then
457470
CSI_DRIVER_HOST_PATH_PATH="$TARGET_PATH/csi-driver-host-path/deploy/kubernetes-1.28"
458471
fi
@@ -736,9 +749,11 @@ get_kind_image() {
736749

737750
get_kind_images() {
738751
cat << EOF
739-
v1.31.0@sha256:18fbefc20a7113353c7b75b5c869d7145a6abd6269154825872dc59c1329912e
740-
v1.30.6@sha256:b6d08db72079ba5ae1f4a88a09025c0a904af3b52387643c285442afb05ab994
741-
v1.29.10@sha256:3b2d8c31753e6c8069d4fc4517264cd20e86fd36220671fb7d0a5855103aa84b
752+
753+
v1.32.0@sha256:c48c62eac5da28cdadcf560d1d8616cfa6783b58f0d94cf63ad1bf49600cb027
754+
v1.31.4@sha256:2cb39f7295fe7eafee0842b1052a599a4fb0f8bcf3f83d96c7f4864c357c6c30
755+
v1.30.8@sha256:17cd608b3971338d9180b00776cb766c50d0a0b6b904ab4ff52fd3fc5c6369bf
756+
v1.29.12@sha256:62c0672ba99a4afd7396512848d6fc382906b8f33349ae68fb1dbfe549f70dec
742757
v1.28.15@sha256:a7c05c7ae043a0b8c818f5a06188bc2c4098f6cb59ca7d1856df00375d839251
743758
v1.27.16@sha256:2d21a61643eafc439905e18705b8186f3296384750a835ad7a005dceb9546d20
744759
v1.26.15@sha256:c79602a44b4056d7e48dc20f7504350f1e87530fe953428b792def00bc1076dd

stackgres-k8s/e2e/spec/abstract/dbops-major-version-upgrade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ reset_cluster_internal() {
103103
fi
104104

105105
wait_pods_running "$CLUSTER_NAMESPACE" "$PODS_RUNNING"
106-
wait_cluster "$CLUSTER_NAME" "$CLUSTER_NAMESPACE"
106+
SWITCHOVER_TO_FIRST=true wait_cluster "$CLUSTER_NAME" "$CLUSTER_NAMESPACE"
107107

108108
if [ "$ONLY_PG_REPACK" != true ] && [ -n "$SOURCE_POSTGIS_VERSION" ] && [ "$SOURCE_POSTGIS_VERSION" = "$TARGET_POSTGIS_VERSION" ]
109109
then

stackgres-k8s/e2e/spec/abstract/dbops-minor-version-upgrade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ reset_cluster() {
2323
--set-string cluster.postgres.version="$E2E_MINOR_SOURCE_POSTGRES_VERSION"
2424

2525
wait_pods_running "$CLUSTER_NAMESPACE" 3
26-
wait_cluster "$CLUSTER_NAME" "$CLUSTER_NAMESPACE"
26+
SWITCHOVER_TO_FIRST=true wait_cluster "$CLUSTER_NAME" "$CLUSTER_NAMESPACE"
2727

2828
set_restarted_pods
2929

stackgres-k8s/e2e/spec/abstract/dbops-pgbench

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,20 @@ check_pgbench() {
183183
fail "pgbench did not returned the statements script."
184184
fi
185185

186-
if kubectl get -n "$CLUSTER_NAMESPACE" sgdbops "$DBOPS_NAME" \
187-
--template '{{ .status.benchmark.pgbench.hdrHistogram }}' | grep -x '[0-9A-Za-z+/=]\+'
186+
kubectl get -n "$CLUSTER_NAMESPACE" pod -l "app=StackGresCluster,stackgres.io/cluster-name=$CLUSTER_NAME,stackgres.io/cluster=true" -o json \
187+
| jq -r '.items[0].spec.containers[0].image' | grep -q '^.*-build-6\.\(.*\)$'
188+
189+
if kubectl get -n "$CLUSTER_NAMESPACE" pod -l "app=StackGresCluster,stackgres.io/cluster-name=$CLUSTER_NAME,stackgres.io/cluster=true" -o json \
190+
| jq -r '.items[0].spec.containers[0].image' | sed 's/^.*-build-6\.\(.*\)$/\1/' \
191+
| test "$(cat)" -ge 35
188192
then
189-
success "pgbench returned the HdrHistogram."
190-
else
191-
fail "pgbench did not returned the HdrHistogram."
193+
if kubectl get -n "$CLUSTER_NAMESPACE" sgdbops "$DBOPS_NAME" \
194+
--template '{{ .status.benchmark.pgbench.hdrHistogram }}' | grep -x '[0-9A-Za-z+/=]\+'
195+
then
196+
success "pgbench returned the HdrHistogram."
197+
else
198+
fail "pgbench did not returned the HdrHistogram."
199+
fi
192200
fi
193201

194202
RESULT="$(run_query -i 0 -p 5432 -q "SELECT EXISTS(SELECT * FROM pg_database WHERE datname LIKE 'pgbench-%')")"

stackgres-k8s/e2e/spec/autoscaling

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
#!/bin/sh
22

3+
e2e_exclusive_lock() {
4+
true
5+
}
6+
37
e2e_test_install() {
48
if [ "$(echo "$K8S_VERSION" | tr . '\n' | head -n 2 | xargs -I @ printf '%05d' @)" \
59
-lt "$(echo "1.23" | tr . '\n' | xargs -I @ printf '%05d' @)" ]
610
then
711
return
812
fi
913

14+
k8s_cleanup_namespace "$OPERATOR_NAMESPACE"
15+
k8s_async_cleanup
16+
17+
kubectl create namespace "$OPERATOR_NAMESPACE"
18+
19+
install_operator_only
20+
1021
install_metric_server
1122
install_keda
1223
if [ "$E2E_DISABLE_VPA" != true ]

stackgres-k8s/e2e/spec/cluster-api-info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ get_api_cluster_info() {
3434

3535
assert_string_equal "$CLUSTER_NAME.$CLUSTER_NAMESPACE" "$CLUSTER_INFO_PRIMARYDNS"
3636
assert_string_equal "$CLUSTER_NAME-replicas.$CLUSTER_NAMESPACE" "$CLUSTER_INFO_REPLICADNS"
37-
assert_string_equal "postgres" "$CLUSTER_INFO_USERNAME"
37+
assert_string_equal "${E2E_SUPERUSER_USERNAME:-postgres}" "$CLUSTER_INFO_USERNAME"
3838
assert_string_equal "$CLUSTER_NAME" "$CLUSTER_INFO_SECRETNAME"
3939
assert_string_equal "superuser-password" "$CLUSTER_INFO_PWKEY"
4040
}

stackgres-k8s/e2e/spec/dbops-major-version-upgrade

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ EOF
5050
--set cluster.configurations.backups.retention=2 \
5151
--set-string cluster.configurations.backups.cronSchedule='0 5 31 2 *' \
5252
--set-string cluster.configurations.backups.sgObjectStorage=backupconf \
53-
--set cluster.postgres.ssl.enabled=true
53+
--set cluster.postgres.ssl.enabled=true \
54+
--set-string cluster.replication.mode=sync \
55+
--set cluster.replication.syncInstances=1
5456

5557
local BACKUP_NAME_PRE BACKUP_NAME_POST
5658
BACKUP_NAME_PRE="$(get_sgbackup_name "$CLUSTER_NAME-pre")"

0 commit comments

Comments
 (0)