diff --git a/e2e-tests/conf/eks-storage-class.yaml b/e2e-tests/conf/eks-storage-class.yaml new file mode 100644 index 000000000..4ddfa8fda --- /dev/null +++ b/e2e-tests/conf/eks-storage-class.yaml @@ -0,0 +1,12 @@ +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: gp3-expandable + annotations: + storageclass.kubernetes.io/is-default-class: "true" +provisioner: ebs.csi.aws.com +parameters: + type: gp3 +allowVolumeExpansion: true +reclaimPolicy: Delete +volumeBindingMode: WaitForFirstConsumer \ No newline at end of file diff --git a/e2e-tests/functions b/e2e-tests/functions index e48cb6d3a..a02a864a3 100755 --- a/e2e-tests/functions +++ b/e2e-tests/functions @@ -9,6 +9,12 @@ if oc get projects 2>/dev/null; then OPENSHIFT=4 fi +if [ $(kubectl version -o json | jq -r '.serverVersion.gitVersion' | grep "\-eks\-") ]; then + EKS=1 +else + EKS=0 +fi + init_temp_dir() { rm -rf "$TEMP_DIR" mkdir -p "$TEMP_DIR" @@ -317,6 +323,7 @@ deploy_minio() { prepare_vault_tls() { local name=$1 local namespace=$2 + local platform=$3 local csr_name=vault-csr-${RANDOM} local csr_api_ver="v1" local csr_signer @@ -423,14 +430,17 @@ _deploy_vault() { if [[ ${platform} == "openshift" ]]; then oc patch clusterrole system:auth-delegator --type='json' -p '[{"op":"add","path":"/rules/-", "value":{"apiGroups":["security.openshift.io"], "attributeRestrictions":null, "resourceNames": ["privileged"], "resources":["securitycontextconstraints"],"verbs":["use"]}}]' + local extra_args="--set server.image.repository=docker.io/hashicorp/vault \ + --set injector.image.repository=docker.io/hashicorp/vault-k8s" fi if [ $protocol == "https" ]; then - prepare_vault_tls ${name} ${namespace} + prepare_vault_tls ${name} ${namespace} ${platform} helm install $name hashicorp/vault \ --disable-openapi-validation \ --version ${VAULT_VER} \ --namespace "${namespace}" \ + $extra_args \ --set dataStorage.enabled=false \ --set global.tlsDisable=false \ --set global.logLevel="trace" \ @@ -455,6 +465,7 @@ storage \"file\" { --disable-openapi-validation \ --version ${VAULT_VER} \ --namespace "${namespace}" \ + $extra_args \ --set dataStorage.enabled=false \ --set global.logLevel="trace" \ --set global.platform="${platform}" @@ -503,6 +514,14 @@ deploy_vault() { local tmp_dir=/tmp/vault echo "Using tmp dir: ${tmp_dir}" + if [[ -n ${OPENSHIFT} ]]; then + platform=openshift + fi + + if [ "$EKS" = 1 ]; then + platform=eks + fi + _deploy_vault ${name} ${protocol} ${platform} ${namespace} ${tmp_dir} local unsealKey=$(jq -r ".unseal_keys_b64[]" <"$tmp_dir/$name") @@ -1018,15 +1037,23 @@ check_passwords_leak() { } deploy_chaos_mesh() { - destroy_chaos_mesh + local container_runtime="containerd" + local socket_path="/run/containerd/containerd.sock" - helm repo add chaos-mesh https://charts.chaos-mesh.org + destroy_chaos_mesh + if [ -n "${MINIKUBE}" ]; then - helm install chaos-mesh chaos-mesh/chaos-mesh --namespace=${NAMESPACE} --set chaosDaemon.runtime=docker --set dashboard.create=false --version ${CHAOS_MESH_VER} - else - helm install chaos-mesh chaos-mesh/chaos-mesh --namespace=${NAMESPACE} --set chaosDaemon.runtime=containerd --set chaosDaemon.socketPath=/run/containerd/containerd.sock --set dashboard.create=false --version ${CHAOS_MESH_VER} + container_runtime=docker + socket_path=/var/run/docker.sock + elif [ -n "${OPENSHIFT}" ]; then + container_runtime=crio + socket_path=/var/run/crio/crio.sock fi - if [[ -n $OPENSHIFT ]]; then + + helm repo add chaos-mesh https://charts.chaos-mesh.org + helm install chaos-mesh chaos-mesh/chaos-mesh --namespace=${NAMESPACE} --set chaosDaemon.runtime=$container_runtime --set chaosDaemon.socketPath=$socket_path --set dashboard.create=false --version ${CHAOS_MESH_VER} + + if [ -n "${OPENSHIFT}" ]; then oc adm policy add-scc-to-user privileged -z chaos-daemon --namespace=${NAMESPACE} fi @@ -1220,7 +1247,8 @@ check_primary_chaos() { online_members=$(get_innodb_cluster_status ${uri} \ | jq .defaultReplicaSet.topology[].status \ | grep ONLINE \ - | wc -l) + | wc -l \ + | sed 's/ //g') if [[ ${online_members} != 3 ]]; then echo "expected 3 online members, got ${online_members}" diff --git a/e2e-tests/tests/gr-self-healing/01-deploy-chaos-mesh.yaml b/e2e-tests/tests/gr-self-healing/01-deploy-chaos-mesh.yaml index e5638625e..3d82c0c9b 100644 --- a/e2e-tests/tests/gr-self-healing/01-deploy-chaos-mesh.yaml +++ b/e2e-tests/tests/gr-self-healing/01-deploy-chaos-mesh.yaml @@ -8,4 +8,4 @@ commands: source ../../functions deploy_chaos_mesh - timeout: 120 + timeout: 240 diff --git a/e2e-tests/tests/gr-self-healing/14-assert.yaml b/e2e-tests/tests/gr-self-healing/14-assert.yaml index 75392ca55..17652658d 100644 --- a/e2e-tests/tests/gr-self-healing/14-assert.yaml +++ b/e2e-tests/tests/gr-self-healing/14-assert.yaml @@ -1,6 +1,6 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert -timeout: 480 +timeout: 720 --- kind: StatefulSet apiVersion: apps/v1 diff --git a/e2e-tests/tests/gr-self-healing/17-assert.yaml b/e2e-tests/tests/gr-self-healing/17-assert.yaml index 75392ca55..17652658d 100644 --- a/e2e-tests/tests/gr-self-healing/17-assert.yaml +++ b/e2e-tests/tests/gr-self-healing/17-assert.yaml @@ -1,6 +1,6 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert -timeout: 480 +timeout: 720 --- kind: StatefulSet apiVersion: apps/v1 diff --git a/e2e-tests/tests/pvc-resize/01-assert.yaml b/e2e-tests/tests/pvc-resize/01-assert.yaml index 9855a8fcf..60df98384 100644 --- a/e2e-tests/tests/pvc-resize/01-assert.yaml +++ b/e2e-tests/tests/pvc-resize/01-assert.yaml @@ -1,6 +1,6 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert -timeout: 300 +timeout: 400 --- apiVersion: ps.percona.com/v1alpha1 kind: PerconaServerMySQL diff --git a/e2e-tests/tests/pvc-resize/01-create-cluster.yaml b/e2e-tests/tests/pvc-resize/01-create-cluster.yaml index 396ad4a98..69a827627 100644 --- a/e2e-tests/tests/pvc-resize/01-create-cluster.yaml +++ b/e2e-tests/tests/pvc-resize/01-create-cluster.yaml @@ -8,6 +8,10 @@ commands: source ../../functions + if [ "$EKS" = 1 ]; then + kubectl apply -f ../../conf/eks-storage-class.yaml + fi + get_cr \ | yq eval '.spec.mysql.clusterType="group-replication"' - \ | yq eval '.spec.mysql.size=3' - \