Skip to content

Commit

Permalink
fix: Resolve instability with SG for Pods lab cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
niallthomson committed Sep 28, 2024
1 parent 54a2f80 commit f161993
Showing 1 changed file with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@ logmessage "Deleting Security Group policies..."

kubectl delete SecurityGroupPolicy --all -A

sleep 10
sleep 30

# Clear the catalog pods so the SG can be deleted
kubectl rollout restart -n catalog deployment/catalog

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)

for INSTANCE_ID in $INSTANCE_IDS
do
aws ec2 terminate-instances --instance-ids $INSTANCE_ID
done

sleep 60
kubectl delete namespace catalog

0 comments on commit f161993

Please sign in to comment.