Skip to content

Commit 5856026

Browse files
authored
K8SPSMDB-1498 EKS and OPenshift test fixes (#2255)
1 parent 9805288 commit 5856026

File tree

5 files changed

+72
-5
lines changed

5 files changed

+72
-5
lines changed

e2e-tests/demand-backup-eks-credentials-irsa/run

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ create_infra "$namespace"
5353
desc "create secrets and start client"
5454
kubectl_bin apply \
5555
-f "$conf_dir/secrets.yml" \
56-
-f "$conf_dir/client.yml"
56+
-f "$conf_dir/client.yml" \
57+
-f "$conf_dir/cloud-secret.yml"
5758

5859
desc "create PSMDB cluster $cluster"
5960
apply_cluster $test_dir/conf/$cluster.yml
@@ -118,6 +119,7 @@ desc 'check backup and restore -- aws-s3'
118119
backup_dest_aws=$(get_backup_dest "$backup_name_aws")
119120
setup_aws_credentials
120121
check_backup_existence_aws "$backup_dest_aws" "/rs0/myApp.test.gz"
122+
unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY
121123
run_mongo 'use myApp\n db.test.insert({ x: 100501 })' "myApp:myPass@$cluster-rs0.$namespace"
122124
compare_mongo_cmd "find" "myApp:myPass@$cluster-rs0-0.$cluster-rs0.$namespace" "-2nd"
123125
compare_mongo_cmd "find" "myApp:myPass@$cluster-rs0-1.$cluster-rs0.$namespace" "-2nd"

e2e-tests/non-voting-and-hidden/compare/statefulset_some-name-rs0-hidden-oc.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ spec:
114114
- readiness
115115
- --component
116116
- mongod
117+
- --ssl
118+
- --sslInsecure
119+
- --sslCAFile
120+
- /etc/mongodb-ssl/ca.crt
121+
- --sslPEMKeyFile
122+
- /tmp/tls.pem
117123
failureThreshold: 8
118124
initialDelaySeconds: 10
119125
periodSeconds: 3
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
apiVersion: psmdb.percona.com/v1
2+
kind: PerconaServerMongoDB
3+
metadata:
4+
name: some-name
5+
finalizers:
6+
- percona.com/delete-psmdb-pods-in-order
7+
- percona.com/delete-psmdb-pvc
8+
spec:
9+
image:
10+
imagePullPolicy: Always
11+
allowUnsafeConfigurations: false
12+
storageScaling:
13+
enableVolumeScaling: true
14+
autoscaling:
15+
enabled: true
16+
triggerThresholdPercent: 50
17+
growthStep: "2Gi"
18+
maxSize: "10Gi"
19+
backup:
20+
enabled: false
21+
replsets:
22+
- name: rs0
23+
affinity:
24+
antiAffinityTopologyKey: none
25+
resources:
26+
limits:
27+
cpu: 500m
28+
memory: 0.5G
29+
requests:
30+
cpu: 100m
31+
memory: 0.1G
32+
volumeSpec:
33+
persistentVolumeClaim:
34+
storageClassName: gp2-resizable
35+
resources:
36+
requests:
37+
storage: 1G
38+
size: 3
39+
secrets:
40+
users: some-users

e2e-tests/pvc-auto-resize/run

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ kubectl_bin apply \
126126

127127
desc 'create PSMDB cluster with storageAutoscaling enabled'
128128
cluster="some-name"
129-
spinup_psmdb "${cluster}-rs0" "$test_dir/conf/$cluster.yml"
129+
if [ "$EKS" == 1 ]; then
130+
spinup_psmdb "${cluster}-rs0" "$test_dir/conf/$cluster-eks.yml"
131+
else
132+
spinup_psmdb "${cluster}-rs0" "$test_dir/conf/$cluster.yml"
133+
fi
130134

131135
desc 'verify initial PVC size is 1Gi'
132136
initial_size=$(get_pvc_size "mongod-data-${cluster}-rs0-0")
@@ -156,11 +160,11 @@ wait_cluster_consistency "$cluster" 64
156160
desc 'verify cluster is ready'
157161
kubectl_bin get psmdb "${cluster}" -o jsonpath='{.status.state}' | grep -q "ready"
158162

159-
if [[ -n ${OPENSHIFT} ]]; then
160-
# On OpenShift (AWS), EBS volumes can only be expanded once every 6 hours.
163+
if [[ -n ${OPENSHIFT} || "$EKS" == 1 ]]; then
164+
# On AWS (OpenShift/EKS), EBS volumes can only be expanded once every 6 hours.
161165
# Skip the multi-resize quota and maxSize tests since they require
162166
# multiple sequential resizes of the same volume.
163-
echo "OpenShift detected, skipping multi-resize tests (AWS EBS rate limit)"
167+
echo "OpenShift/AWS environment detected, skipping multi-resize tests (EBS rate limit)"
164168
destroy "${namespace}"
165169
desc "test passed"
166170
exit 0

e2e-tests/pvc-resize/run

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ function apply_resourcequota() {
4949
function wait_cluster_status() {
5050
local cluster=$1
5151
local expected=$2
52+
local retry=0
5253

5354
echo -n "Waiting for psmdb/${cluster} status to be ${expected}"
5455
until [[ $(kubectl_bin get psmdb "${cluster}" -o jsonpath='{.status.state}') == "${expected}" ]]; do
@@ -159,6 +160,20 @@ wait_cluster_status ${cluster} "error"
159160
patch_pvc_request "${cluster}" "3G"
160161
wait_cluster_status ${cluster} "ready"
161162

163+
if [[ $EKS == 1 || -n ${OPENSHIFT} ]]; then
164+
echo "Deleting and recreating PSMDB cluster ${cluster} to avoid cloud storage resize cooldown"
165+
kubectl_bin delete psmdb ${cluster}
166+
kubectl_bin apply -f "$conf_dir/secrets.yml"
167+
if [ "$EKS" == 1 ]; then
168+
spinup_psmdb "${cluster}-rs0" "$test_dir/conf/$cluster-eks.yml"
169+
else
170+
spinup_psmdb "${cluster}-rs0" "$test_dir/conf/$cluster.yml"
171+
fi
172+
kubectl_bin patch psmdb "${cluster}" --type=json -p='[{"op": "add", "path": "/spec/storageScaling", "value":{"enableVolumeScaling":true} }]'
173+
sleep 10
174+
wait_cluster_consistency "$cluster"
175+
fi
176+
162177
desc "test restartedAt annotation preservation during PVC resize"
163178

164179
echo "delete resourcequota"

0 commit comments

Comments
 (0)