Closed bear454 closed 1 year ago
Holding until smaller PRs are merged in.
Example download: suse-rancher-setup-cleanup-2023-02-14T19 39 53-08 00.txt
export AWS_REGION='us-west-2'
export AWS_DEFAULT_REGION='us-west-2'
export AWS_DEFAULT_OUTPUT='json'
export KUBECONFIG='/tmp/kubeconfig'
aws eks update-kubeconfig --name suse-rancher-setup-XXXX-cluster --kubeconfig /tmp/kubeconfig
aws route53 change-resource-record-sets --hosted-zone-id /hostedzone/XXXXXXXXXXXXXXXXXXXXXX --change-batch {"Comment":"Delete suse-rancher-setup record set","Changes":[{"Action":"DELETE","ResourceRecordSet":{"Name":"XXXXXXXXXXXX.aws.XXXXXXX.com","Type":"CNAME","TTL":900,"ResourceRecords":[{"Value":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.us-west-2.elb.amazonaws.com"}]}}]}
helm uninstall ingress-nginx --namespace ingress-nginx
aws eks delete-nodegroup --nodegroup-name suse-rancher-setup-XXXX-cluster-nodegroup --cluster-name suse-rancher-setup-XXXX-cluster
aws iam detach-role-policy --role-name suse-rancher-setup-XXXX-nodegroup-role --policy-arn arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore
...
Cleanup now occurs in it's own controller (reducing a bunch of conditional logic). Recording is stored in the database as a set of env vars & a set of commands; these can be rendered out via an ERB template.