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

fix: Improve reliability of custom networking cleanup #1118

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -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..."

Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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
Loading