diff --git a/scripts/lib/cluster.sh b/scripts/lib/cluster.sh index 35fd2cc67d..c8458d6d30 100644 --- a/scripts/lib/cluster.sh +++ b/scripts/lib/cluster.sh @@ -16,15 +16,15 @@ function up-test-cluster() { AWS_K8S_TESTER_EKS_NAME=$CLUSTER_NAME \ AWS_K8S_TESTER_EKS_KUBECONFIG_PATH=$KUBECONFIG_PATH \ AWS_K8S_TESTER_EKS_KUBECTL_PATH=$KUBECTL_PATH \ - AWS_K8S_TESTER_EKS_S3_BUCKET_NAME=amazon-vpc-cni-k8s-aws-k8s-tester \ - AWS_K8S_TESTER_EKS_S3_BUCKET_CREATE=false \ + AWS_K8S_TESTER_EKS_S3_BUCKET_NAME=$S3_BUCKET_NAME \ + AWS_K8S_TESTER_EKS_S3_BUCKET_CREATE=$S3_BUCKET_CREATE \ AWS_K8S_TESTER_EKS_PARAMETERS_VERSION=${K8S_VERSION%.*} \ AWS_K8S_TESTER_EKS_PARAMETERS_ENCRYPTION_CMK_CREATE=false \ - AWS_K8S_TESTER_EKS_PARAMETERS_ROLE_CREATE=false \ - AWS_K8S_TESTER_EKS_PARAMETERS_ROLE_ARN=arn:aws:iam::404174646922:role/K8sTester-ClusterManagementRole \ + AWS_K8S_TESTER_EKS_PARAMETERS_ROLE_CREATE=$ROLE_CREATE \ + AWS_K8S_TESTER_EKS_PARAMETERS_ROLE_ARN=$ROLE_ARN \ AWS_K8S_TESTER_EKS_ADD_ON_MANAGED_NODE_GROUPS_ENABLE=true \ - AWS_K8S_TESTER_EKS_ADD_ON_MANAGED_NODE_GROUPS_ROLE_CREATE=false \ - AWS_K8S_TESTER_EKS_ADD_ON_MANAGED_NODE_GROUPS_ROLE_ARN=arn:aws:iam::404174646922:role/K8sTester-ClusterManagementRole \ + AWS_K8S_TESTER_EKS_ADD_ON_MANAGED_NODE_GROUPS_ROLE_CREATE=$ROLE_CREATE \ + AWS_K8S_TESTER_EKS_ADD_ON_MANAGED_NODE_GROUPS_ROLE_ARN=$ROLE_ARN \ AWS_K8S_TESTER_EKS_ADD_ON_MANAGED_NODE_GROUPS_MNGS='{"GetRef.Name-mng-for-cni":{"name":"GetRef.Name-mng-for-cni","remote-access-user-name":"ec2-user","tags":{"group":"amazon-vpc-cni-k8s"},"release-version":"","ami-type":"AL2_x86_64","asg-min-size":3,"asg-max-size":3,"asg-desired-capacity":3,"instance-types":["c5.xlarge"],"volume-size":40}}' \ AWS_K8S_TESTER_EKS_ADD_ON_MANAGED_NODE_GROUPS_FETCH_LOGS=true \ AWS_K8S_TESTER_EKS_ADD_ON_NLB_HELLO_WORLD_ENABLE=true \ diff --git a/scripts/run-integration-tests.sh b/scripts/run-integration-tests.sh index 029bc8aa06..1467fcf7b3 100755 --- a/scripts/run-integration-tests.sh +++ b/scripts/run-integration-tests.sh @@ -11,7 +11,7 @@ source $DIR/lib/cluster.sh OS=$(go env GOOS) ARCH=$(go env GOARCH) -: ${AWS_REGION:=us-west-2} +: ${AWS_DEFAULT_REGION:=us-west-2} : ${K8S_VERSION:=1.14.6} : ${PROVISION:=true} : ${DEPROVISION:=true} @@ -75,13 +75,19 @@ check_aws_credentials ensure_aws_k8s_tester : ${AWS_ACCOUNT_ID:=$(aws sts get-caller-identity --query Account --output text)} -: ${AWS_ECR_REGISTRY:="$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com"} +: ${AWS_ECR_REGISTRY:="$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com"} : ${AWS_ECR_REPO_NAME:="amazon-k8s-cni"} : ${IMAGE_NAME:="$AWS_ECR_REGISTRY/$AWS_ECR_REPO_NAME"} +: ${ROLE_CREATE:=true} +: ${ROLE_ARN:=""} + +# S3 bucket initialization +: ${S3_BUCKET_CREATE:=true} +: ${S3_BUCKET_NAME:=""} # `aws ec2 get-login` returns a docker login string, which we eval here to # login to the ECR registry -eval $(aws ecr get-login --region $AWS_REGION --no-include-email) >/dev/null 2>&1 +eval $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email) >/dev/null 2>&1 ensure_ecr_repo "$AWS_ACCOUNT_ID" "$AWS_ECR_REPO_NAME" # Check to see if the image already exists in the Docker repository, and if @@ -107,7 +113,7 @@ else fi echo "*******************************************************************************" -echo "Running $TEST_ID on $CLUSTER_NAME in $AWS_REGION" +echo "Running $TEST_ID on $CLUSTER_NAME in $AWS_DEFAULT_REGION" echo "+ Cluster config dir: $TEST_CLUSTER_DIR" echo "+ Result dir: $TEST_DIR" echo "+ Tester: $TESTER_PATH" @@ -152,8 +158,8 @@ echo "Updating CNI to image $IMAGE_NAME:$TEST_IMAGE_VERSION" $KUBECTL_PATH apply -f "$TEST_CONFIG_PATH" # Delay based on 3 nodes, 30s grace period per CNI pod -echo "Sleeping for 110s" echo "TODO: Poll and wait for updates to complete instead!" +echo "Sleeping for 110s" sleep 110 echo "*******************************************************************************" @@ -169,7 +175,7 @@ if [[ $TEST_PASS -eq 0 && "$RUN_CONFORMANCE" == true ]]; then echo "Running conformance tests against cluster." wget -qO- https://dl.k8s.io/v$K8S_VERSION/kubernetes-test.tar.gz | tar -zxvf - --strip-components=4 -C /tmp kubernetes/platforms/linux/amd64/e2e.test /tmp/e2e.test --ginkgo.focus="Conformance" --kubeconfig=$KUBECONFIG --ginkgo.failFast --ginkgo.flakeAttempts 2 \ - --ginkgo.skip="(should support remote command execution over websockets)|(should support retrieving logs from the container over websockets)" + --ginkgo.skip="(should support remote command execution over websockets)|(should support retrieving logs from the container over websockets)|\[Slow\]" fi if [[ "$DEPROVISION" == true ]]; then