Skip to content

Commit

Permalink
ci: fix aws eks cluster creation
Browse files Browse the repository at this point in the history
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
  • Loading branch information
aramase committed May 19, 2022
1 parent 0c739a9 commit ce47672
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,12 @@ KIND := kind
KUBECTL := kubectl
ENVSUBST := envsubst
EKSCTL := eksctl
AWS_CLI := aws
YQ := yq

# Test variables
KIND_VERSION ?= 0.13.0
KUBERNETES_VERSION ?= 1.23.5
KUBECTL_VERSION ?= 1.23.5
KUBERNETES_VERSION ?= 1.24.0
KUBECTL_VERSION ?= 1.24.0
BATS_VERSION ?= 1.4.1
TRIVY_VERSION ?= 0.24.4
PROTOC_VERSION ?= 3.15.2
Expand Down
16 changes: 15 additions & 1 deletion test/scripts/initialize_eks_cluster.bash
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
EKS_CLUSTER_NAME=$1
IMAGE_VERSION=$2

install_aws_cli() {
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip > /dev/null 2>&1
./aws/install
aws --version
}

# install the latest aws-cli
install_aws_cli
# log the kubectl version
kubectl version --client=true

if [ -z "$AWS_REGION" ]; then
AWS_REGION="us-west-2"
fi
Expand All @@ -41,7 +53,9 @@ if [ -z "$RELEASE" ]; then
docker push $CRD_IMAGE_TAG
fi

eksctl create cluster --name $EKS_CLUSTER_NAME --node-type m5.large --region $AWS_REGION
eksctl create cluster --name $EKS_CLUSTER_NAME --node-type m5.large --region $AWS_REGION
# update kubeconfig for https://github.com/aws/aws-cli/issues/6920
aws eks update-kubeconfig --name $EKS_CLUSTER_NAME --region $AWS_REGION
eksctl utils associate-iam-oidc-provider --name $EKS_CLUSTER_NAME --approve --region $AWS_REGION
eksctl create iamserviceaccount \
--name $AWS_SERVICE_ACCOUNT_NAME \
Expand Down

0 comments on commit ce47672

Please sign in to comment.