-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdelete.sh
executable file
·26 lines (21 loc) · 1.58 KB
/
delete.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
echo "Make sure you have deleted all the helm releases for the 'sample app' (ignore aws-load-balancer-controller release, this is deleted automatically by this script)"
helm ls --all-namespaces
echo "If all Helm are deleted, please press [ENTER], if not [CTRL+C] and do so"
echo "If the 'sample-app' and 'services-api' releases are not deleted, this won't delete load balancers, target groups, DynamoDB Tables, or Route53 records automatically."
read
kubectl delete -f external-dns/external-dns.yaml
helm delete --namespace kube-system aws-load-balancer-controller
helm delete --namespace ack-system ack-dynamodb-controller
eksctl delete iamserviceaccount --name external-dns --cluster my-eks-cluster
eksctl delete iamserviceaccount --name aws-load-balancer-controller --namespace kube-system --cluster my-eks-cluster
eksctl delete iamserviceaccount --name ack-dynamodb-controller --namespace ack-system --cluster my-eks-cluster
sleep 5
eksctl get iamserviceaccount --cluster my-eks-cluster
echo "If all IAM Roles for Service Accounts for the 'services-api' and 'sample-app' are deleted, please press [ENTER], if not [CTRL+C] and do so"
echo "Example of how to delete one: eksctl delete iamserviceaccount --name services-api --namespace develop --cluster my-eks-cluster"
read
eksctl delete cluster --name my-eks-cluster
aws cloudformation delete-stack --stack-name external-dns-iam-policy
aws cloudformation delete-stack --stack-name aws-load-balancer-controller-iam-policy
aws cloudformation delete-stack --stack-name services-api-policy
aws cloudformation delete-stack --stack-name dynamodb-controller-iam-policy