Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create roles by default for e2e test cluster creation #994

Merged
merged 23 commits into from
May 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2d1f39e
Testing CircleCI.
bnapolitan May 20, 2020
94244c2
Create role when spinning up tester.
bnapolitan May 20, 2020
a07bb0f
Change to role create in second field.
bnapolitan May 20, 2020
d1f3aeb
Insert my own arn.
bnapolitan May 20, 2020
8215401
Set create for s3 tester bucket.
bnapolitan May 20, 2020
5419999
Create s3 bucket empty name.
bnapolitan May 20, 2020
964977b
Revert back to role creation.
bnapolitan May 20, 2020
2564c23
Region changes from CircleCI environment variable, and comment out de…
bnapolitan May 21, 2020
98d667e
Test polling for available pods.
bnapolitan May 21, 2020
b4e6a59
Revert polling solution and skip slow conformance tests.
bnapolitan May 26, 2020
bbf4824
Merge branch 'master' of https://github.com/aws/amazon-vpc-cni-k8s in…
bnapolitan May 26, 2020
dee523b
Small changes back to original.
bnapolitan May 26, 2020
aebf19d
Merge branch 'master' of https://github.com/aws/amazon-vpc-cni-k8s in…
bnapolitan May 26, 2020
63a64e3
Change var name to "AWS_DEFAULT_REGION".
bnapolitan May 26, 2020
fa8fee1
Add env variables for role and s3.
bnapolitan May 27, 2020
013b85a
Testing CircleCI.
bnapolitan May 20, 2020
faa5b1c
Autogenerate per-region YAML manifests from a common template
anguslees May 20, 2020
75bbfca
Small changes back to original.
bnapolitan May 26, 2020
89758ca
Update run-integration-tests.sh to default to config/master
anguslees May 25, 2020
a8823fc
scripts/lib/aws: bump up aws-k8s-tester to v1.2.6
gyuho May 25, 2020
f4f40f8
Change var name to "AWS_DEFAULT_REGION".
bnapolitan May 26, 2020
742995d
Add env variables for role and s3.
bnapolitan May 27, 2020
b020513
Merge branch 'test-circle-ci' of https://github.com/bnapolitan/amazon…
bnapolitan May 27, 2020
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
12 changes: 6 additions & 6 deletions scripts/lib/cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
18 changes: 12 additions & 6 deletions scripts/run-integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
bnapolitan marked this conversation as resolved.
Show resolved Hide resolved
: ${K8S_VERSION:=1.14.6}
: ${PROVISION:=true}
: ${DEPROVISION:=true}
Expand Down Expand Up @@ -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:=""}
Comment on lines +81 to +86
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!


# `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
Expand All @@ -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"
Expand Down Expand Up @@ -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 "*******************************************************************************"
Expand All @@ -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
Expand Down