From 587e3fe02a07c2b759da92fad510c9c3412c6528 Mon Sep 17 00:00:00 2001 From: Niall Thomson Date: Fri, 27 Sep 2024 21:38:57 -0600 Subject: [PATCH] fix: Improve reliability of custom networking cleanup --- .../networking/custom-networking/.workshop/cleanup.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/manifests/modules/networking/custom-networking/.workshop/cleanup.sh b/manifests/modules/networking/custom-networking/.workshop/cleanup.sh index 80913ff3a..10b0fd6cc 100644 --- a/manifests/modules/networking/custom-networking/.workshop/cleanup.sh +++ b/manifests/modules/networking/custom-networking/.workshop/cleanup.sh @@ -2,7 +2,7 @@ set -e -logmessage "WARNING! This lab takes additional time to clean up to ensure lab stability, please be patient" +logmessage "WARNING! This lab takes additional time to clean up to ensure workshop stability, please be patient" logmessage "Deleting ENI configs..." @@ -16,6 +16,8 @@ kubectl set env daemonset aws-node -n kube-system AWS_VPC_K8S_CNI_CUSTOM_NETWORK sleep 10 +kubectl delete namespace checkout + logmessage "Terminating EKS worker nodes..." INSTANCE_IDS=$(aws autoscaling describe-auto-scaling-groups --filters "Name=tag:eks:nodegroup-name,Values=$EKS_DEFAULT_MNG_NAME" "Name=tag:eks:cluster-name,Values=$EKS_CLUSTER_NAME" --query 'AutoScalingGroups[0].Instances[].InstanceId' --output text) @@ -25,8 +27,6 @@ do aws ec2 terminate-instances --instance-ids $INSTANCE_ID done -sleep 30 - custom_nodegroup=$(aws eks list-nodegroups --cluster-name $EKS_CLUSTER_NAME --query "nodegroups[? @ == 'custom-networking']" --output text) if [ ! -z "$custom_nodegroup" ]; then @@ -35,3 +35,7 @@ if [ ! -z "$custom_nodegroup" ]; then aws eks delete-nodegroup --region $AWS_REGION --cluster-name $EKS_CLUSTER_NAME --nodegroup-name custom-networking aws eks wait nodegroup-deleted --cluster-name $EKS_CLUSTER_NAME --nodegroup-name custom-networking fi + +sleep 30 + +kubectl wait --for=condition=Ready --timeout=15m pods -l app.kubernetes.io/created-by=eks-workshop -A \ No newline at end of file