File tree Expand file tree Collapse file tree 5 files changed +72
-5
lines changed
demand-backup-eks-credentials-irsa
non-voting-and-hidden/compare Expand file tree Collapse file tree 5 files changed +72
-5
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,8 @@ create_infra "$namespace"
5353desc " create secrets and start client"
5454kubectl_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
5859desc " create PSMDB cluster $cluster "
5960apply_cluster $test_dir /conf/$cluster .yml
@@ -118,6 +119,7 @@ desc 'check backup and restore -- aws-s3'
118119backup_dest_aws=$( get_backup_dest " $backup_name_aws " )
119120setup_aws_credentials
120121check_backup_existence_aws " $backup_dest_aws " " /rs0/myApp.test.gz"
122+ unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY
121123run_mongo ' use myApp\n db.test.insert({ x: 100501 })' " myApp:myPass@$cluster -rs0.$namespace "
122124compare_mongo_cmd " find" " myApp:myPass@$cluster -rs0-0.$cluster -rs0.$namespace " " -2nd"
123125compare_mongo_cmd " find" " myApp:myPass@$cluster -rs0-1.$cluster -rs0.$namespace " " -2nd"
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change @@ -126,7 +126,11 @@ kubectl_bin apply \
126126
127127desc ' create PSMDB cluster with storageAutoscaling enabled'
128128cluster=" 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
131135desc ' verify initial PVC size is 1Gi'
132136initial_size=$( get_pvc_size " mongod-data-${cluster} -rs0-0" )
@@ -156,11 +160,11 @@ wait_cluster_consistency "$cluster" 64
156160desc ' verify cluster is ready'
157161kubectl_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
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ function apply_resourcequota() {
4949function 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"
159160patch_pvc_request " ${cluster} " " 3G"
160161wait_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+
162177desc " test restartedAt annotation preservation during PVC resize"
163178
164179echo " delete resourcequota"
You can’t perform that action at this time.
0 commit comments