Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions e2e-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,17 @@ Running all tests at once can be done with the following command:
./e2e-tests/run
```

To schedule e2e workloads on nodes with a specific architecture, set `ARCH` when running the tests:

```
ARCH=arm64 ./e2e-tests/run
ARCH=arm64 ./e2e-tests/init-deploy/run
export ARCH=arm64
./e2e-tests/init-deploy/run
```

For GKE Arm nodes, this adds `kubernetes.io/arch: arm64` node selectors and the matching `kubernetes.io/arch=arm64:NoSchedule` toleration to test workloads. On GKE clusters where all current nodes are `arm64`, the tests enable this automatically.

(see how to configure the testing infrastructure [here](#using-environment-variables-to-customize-the-testing-process)).

Tests can also be run one-by-one using the appropriate scripts (their names should be self-explanatory):
Expand Down Expand Up @@ -129,8 +140,8 @@ You can use environment variables to re-declare all default images used for test
full list of variables is the following one:

* `IMAGE` - Percona Server for MongoDB Operator, `perconalab/percona-server-mongodb-operator:main` by default,
* `IMAGE_MONGOD` - mongod, `perconalab/percona-server-mongodb-operator:main-mongod4.4` by default,
* `IMAGE_PMM_CLIENT` - Percona Monitoring and Management (PMM) client, `perconalab/pmm-client:dev-latest` by default,
* `IMAGE_MONGOD` - mongod, `perconalab/percona-server-mongodb-operator:main-mongod8.0` by default,
* `IMAGE_PMM3_CLIENT` - Percona Monitoring and Management (PMM) client, `perconalab/pmm-client:3-dev-latest` by default,
* `IMAGE_BACKUP` - backup, `perconalab/percona-server-mongodb-operator:main-backup` by default,
Comment thread
jvpasinatto marked this conversation as resolved.
Comment thread
jvpasinatto marked this conversation as resolved.

### Using automatic clean-up after testing
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/conf/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
terminationGracePeriodSeconds: 10
containers:
- name: psmdb-client
image: docker.io/percona/percona-server-mongodb:4.4
image: docker.io/percona/percona-server-mongodb:4.4-multi
imagePullPolicy: Always
command:
- sleep
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/conf/client_with_tls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
terminationGracePeriodSeconds: 10
containers:
- name: psmdb-client
image: docker.io/percona/percona-server-mongodb:4.4
image: docker.io/percona/percona-server-mongodb:4.4-multi
imagePullPolicy: Always
command: ["/bin/bash","-c","cat /etc/mongodb-ssl/tls.key /etc/mongodb-ssl/tls.crt > /tmp/tls.pem && sleep 100500"]
volumeMounts:
Expand Down
6 changes: 4 additions & 2 deletions e2e-tests/conf/cmctl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ spec:
serviceAccountName: cmctl
containers:
- name: cmctl
image: curlimages/curl
image: docker.io/alpine/curl:8.17.0
Comment thread
jvpasinatto marked this conversation as resolved.
Outdated
imagePullPolicy: Always
command:
- /bin/sh
- -c
- |
curl -fsSL -o /tmp/cmctl https://github.com/cert-manager/cmctl/releases/download/v2.0.0/cmctl_linux_amd64 \
arch="$(uname -m)" \
&& case "$arch" in x86_64) arch="amd64" ;; aarch64) arch="arm64" ;; esac \
&& curl -fsSL -o /tmp/cmctl https://github.com/cert-manager/cmctl/releases/download/v2.0.0/cmctl_linux_${arch} \
&& chmod +x /tmp/cmctl \
&& sleep 100500
restartPolicy: Always
12 changes: 12 additions & 0 deletions e2e-tests/cross-site-sharded/run
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,18 @@ kubectl_bin patch psmdb ${main_cluster} --type=merge --patch '{
}
}'

if arch_scheduling_enabled; then
arch_patch=$(jq -nc --argjson scheduling "$(arch_psmdb_scheduling_json)" '[
{op: "add", path: "/spec/replsets/0/nodeSelector", value: $scheduling.nodeSelector},
{op: "add", path: "/spec/replsets/0/tolerations", value: $scheduling.tolerations},
{op: "add", path: "/spec/replsets/1/nodeSelector", value: $scheduling.nodeSelector},
{op: "add", path: "/spec/replsets/1/tolerations", value: $scheduling.tolerations},
{op: "add", path: "/spec/sharding/configsvrReplSet/nodeSelector", value: $scheduling.nodeSelector},
{op: "add", path: "/spec/sharding/configsvrReplSet/tolerations", value: $scheduling.tolerations}
]')
kubectl_bin patch psmdb ${main_cluster} --type=json -p="${arch_patch}"
fi

wait_for_members $replica_cfg_0_endpoint cfg 6
wait_for_members $replica_rs0_0_endpoint rs0 6
wait_for_members $replica_rs1_0_endpoint rs1 6
Expand Down
6 changes: 3 additions & 3 deletions e2e-tests/custom-users-roles-sharded/conf/some-name-rs0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ spec:
enabled: false
exposeType: ClusterIP
sidecars:
- image: busybox
- image: docker.io/busybox:latest
command: ["/bin/sh"]
args: ["-c", "while true; do echo echo $(date -u) 'test' >> /dev/null; sleep 5;done"]
name: cfg-sidecar-1
Expand All @@ -130,7 +130,7 @@ spec:
expose:
exposeType: ClusterIP
sidecars:
- image: busybox
- image: docker.io/busybox:latest
command: ["/bin/sh"]
args: ["-c", "while true; do echo echo $(date -u) 'test' >> /dev/null; sleep 5;done"]
name: mongos-sidecar-1
Expand Down Expand Up @@ -180,7 +180,7 @@ spec:
indexConfig:
prefixCompression: true
sidecars:
- image: busybox
- image: docker.io/busybox:latest
command: ["/bin/sh"]
args: ["-c", "while true; do echo echo $(date -u) 'test' >> /dev/null; sleep 5;done"]
name: rs-sidecar-1
Expand Down
6 changes: 3 additions & 3 deletions e2e-tests/demand-backup-sharded/conf/some-name-rs0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ spec:
loadBalancerSourceRanges:
- 10.0.0.0/8
sidecars:
- image: busybox
- image: docker.io/busybox:latest
command: ["/bin/sh"]
args: ["-c", "while true; do echo echo $(date -u) 'test' >> /dev/null; sleep 5;done"]
name: cfg-sidecar-1
Expand All @@ -99,7 +99,7 @@ spec:
loadBalancerSourceRanges:
- 10.0.0.0/8
sidecars:
- image: busybox
- image: docker.io/busybox:latest
command: ["/bin/sh"]
args: ["-c", "while true; do echo echo $(date -u) 'test' >> /dev/null; sleep 5;done"]
name: mongos-sidecar-1
Expand Down Expand Up @@ -248,7 +248,7 @@ spec:
indexConfig:
prefixCompression: true
sidecars:
- image: busybox
- image: docker.io/busybox:latest
command: ["/bin/sh"]
args: ["-c", "while true; do echo echo $(date -u) 'test' >> /dev/null; sleep 5;done"]
name: rs-sidecar-1
Expand Down
4 changes: 1 addition & 3 deletions e2e-tests/demand-backup-sharded/run
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,7 @@ check_data
desc 'delete backup and check if it is removed from bucket -- minio'
kubectl_bin delete psmdb-backup --all

backup_exists=$(kubectl_bin run -i --rm aws-cli --image=docker.io/perconalab/awscli --restart=Never -- \
/usr/bin/env AWS_ACCESS_KEY_ID=some-access-key AWS_SECRET_ACCESS_KEY=some-secret-key AWS_DEFAULT_REGION=us-east-1 \
/usr/bin/aws --endpoint-url http://minio-service:9000 s3 ls s3://operator-testing/ \
backup_exists=$(aws_cli_minio http://minio-service:9000 s3 ls s3://operator-testing/ \
| grep -c ${backup_dest_minio}_ | cat)
if [[ $backup_exists -eq 1 ]]; then
echo "Backup was not removed from bucket -- minio"
Expand Down
8 changes: 2 additions & 6 deletions e2e-tests/demand-backup/run
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,7 @@ run_recovery_check_bkp_source "$backup_name_minio" "$backup_dest_minio" "$cluste

desc 'delete backup and check if it is removed from bucket -- minio'
kubectl_bin delete psmdb-backup --all
backup_exists=$(kubectl_bin run -i --rm aws-cli --image=docker.io/perconalab/awscli --restart=Never -- \
/usr/bin/env AWS_ACCESS_KEY_ID=some-access-key AWS_SECRET_ACCESS_KEY=some-secret-key AWS_DEFAULT_REGION=us-east-1 \
/usr/bin/aws --endpoint-url http://minio-service:9000 s3 ls s3://operator-testing/ \
backup_exists=$(aws_cli_minio http://minio-service:9000 s3 ls s3://operator-testing/ \
| grep -c ${backup_dest_minio} | cat)
if [[ $backup_exists -eq 1 ]]; then
echo "Backup was not removed from bucket -- minio"
Expand Down Expand Up @@ -320,9 +318,7 @@ sleep 60

desc 'delete backup and check if it is removed from bucket -- minio'
kubectl_bin delete psmdb-backup --all
backup_exists=$(kubectl_bin run -i --rm aws-cli --image=docker.io/perconalab/awscli --restart=Never -- \
/usr/bin/env AWS_ACCESS_KEY_ID=some-access-key AWS_SECRET_ACCESS_KEY=some-secret-key AWS_DEFAULT_REGION=us-east-1 \
/usr/bin/aws --endpoint-url http://minio-service:9000 s3 ls s3://operator-testing/ \
backup_exists=$(aws_cli_minio http://minio-service:9000 s3 ls s3://operator-testing/ \
| grep -c ${backup_dest_minio} | cat)
if [[ $backup_exists -eq 1 ]]; then
echo "Backup was not removed from bucket -- minio"
Expand Down
6 changes: 3 additions & 3 deletions e2e-tests/expose-sharded/conf/some-name-rs0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ spec:
enabled: false
type: ClusterIP
sidecars:
- image: busybox
- image: docker.io/busybox:latest
command: ["/bin/sh"]
args: ["-c", "while true; do echo echo $(date -u) 'test' >> /dev/null; sleep 5;done"]
name: cfg-sidecar-1
Expand All @@ -78,7 +78,7 @@ spec:
expose:
type: ClusterIP
sidecars:
- image: busybox
- image: docker.io/busybox:latest
command: ["/bin/sh"]
args: ["-c", "while true; do echo echo $(date -u) 'test' >> /dev/null; sleep 5;done"]
name: mongos-sidecar-1
Expand Down Expand Up @@ -128,7 +128,7 @@ spec:
indexConfig:
prefixCompression: true
sidecars:
- image: busybox
- image: docker.io/busybox:latest
command: ["/bin/sh"]
args: ["-c", "while true; do echo echo $(date -u) 'test' >> /dev/null; sleep 5;done"]
name: rs-sidecar-1
Expand Down
Loading
Loading