Skip to content

Commit

Permalink
update: Upgraded VPC Lattice controller to 1.0.5 (#932)
Browse files Browse the repository at this point in the history
  • Loading branch information
niallthomson authored May 16, 2024
1 parent 22682fb commit b63e713
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions manifests/modules/networking/vpc-lattice/.workshop/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

set -e

logmessage "WARNING: Cleaning up the VPC Lattice module may take up to 10 minutes..."

logmessage "Deleting VPC Lattice routes and gateway..."

kubectl delete namespace checkoutv2 --ignore-not-found
kubectl delete namespace checkout --ignore-not-found

kubectl delete -f ~/environment/eks-workshop/modules/networking/vpc-lattice/routes --ignore-not-found
cat ~/environment/eks-workshop/modules/networking/vpc-lattice/controller/eks-workshop-gw.yaml | envsubst | kubectl delete --ignore-not-found -f -
Expand All @@ -14,7 +17,7 @@ delete-all-if-crd-exists targetgrouppolicies.application-networking.k8s.aws

logmessage "Waiting for VPC Lattice target groups to be deleted..."

timeout -s TERM 300 bash -c \
timeout -s TERM 600 bash -c \
'while [[ ! -z "$(aws vpc-lattice list-target-groups --output text | grep 'checkout' || true)" ]];\
do sleep 10;\
done'
Expand Down Expand Up @@ -44,13 +47,16 @@ if [ ! -z "$ipv6_sg_check" ]; then
aws ec2 revoke-security-group-ingress --group-id $CLUSTER_SG --ip-permissions "PrefixListIds=[{PrefixListId=${PREFIX_LIST_ID_IPV6}}],IpProtocol=-1"
fi

service_network=$(aws vpc-lattice list-service-networks --query "items[?name=="\'$EKS_CLUSTER_NAME\'"].id" | jq -r '.[]')
export service_network=$(aws vpc-lattice list-service-networks --query "items[?name=="\'$EKS_CLUSTER_NAME\'"].id" | jq -r '.[]')
if [ ! -z "$service_network" ]; then
association_id=$(aws vpc-lattice list-service-network-vpc-associations --service-network-identifier $service_network --vpc-identifier $VPC_ID --query 'items[].id' | jq -r '.[]')
if [ ! -z "$association_id" ]; then
logmessage "Deleting Lattice VPC association..."
aws vpc-lattice delete-service-network-vpc-association --service-network-vpc-association-identifier $association_id
sleep 30 # Todo replace with wait
timeout -s TERM 300 bash -c \
'while [[ ! -z "$(aws vpc-lattice list-service-network-vpc-associations --service-network-identifier $service_network --vpc-identifier $VPC_ID --query 'items[].id' --output text || true)" ]];\
do sleep 10;\
done'
fi

logmessage "Deleting Lattice service network..."
Expand Down
2 changes: 1 addition & 1 deletion website/docs/networking/vpc-lattice/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ $ aws ecr-public get-login-password --region us-east-1 \
| helm registry login --username AWS --password-stdin public.ecr.aws
$ helm install gateway-api-controller \
oci://public.ecr.aws/aws-application-networking-k8s/aws-gateway-controller-chart \
--version=v1.0.1 \
--version=v1.0.5 \
--create-namespace \
--set=aws.region=${AWS_REGION} \
--set serviceAccount.annotations."eks\.amazonaws\.com/role-arn"="$LATTICE_IAM_ROLE" \
Expand Down

0 comments on commit b63e713

Please sign in to comment.