Last active
December 23, 2023 03:20
-
-
Save vfarcic/3989a9707f80c2faa445d3953f18a8ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: https://gist.github.com/3989a9707f80c2faa445d3953f18a8ca | |
#################### | |
# Create a cluster # | |
#################### | |
# Follow the instructions from https://github.com/weaveworks/eksctl to intall eksctl if you do not have it already | |
export AWS_ACCESS_KEY_ID=[...] # Replace [...] with the AWS Access Key ID | |
export AWS_SECRET_ACCESS_KEY=[...] # Replace [...] with the AWS Secret Access Key | |
export AWS_DEFAULT_REGION=us-west-2 | |
eksctl create cluster \ | |
--name chaos \ | |
--region $AWS_DEFAULT_REGION \ | |
--node-type t2.xlarge \ | |
--nodes 1 \ | |
--managed | |
################# | |
# Install Istio # | |
################# | |
istioctl manifest install \ | |
--skip-confirmation | |
export INGRESS_HOST=$(kubectl \ | |
--namespace istio-system \ | |
get service istio-ingressgateway \ | |
--output jsonpath="{.status.loadBalancer.ingress[0].hostname}") | |
echo $INGRESS_HOST | |
# Repeat the `export` command if the output of the `echo` command is empty | |
####################### | |
# Destroy the cluster # | |
####################### | |
eksctl delete cluster \ | |
--name chaos \ | |
--region $AWS_DEFAULT_REGION | |
# Delete unused volumes | |
for volume in `aws ec2 describe-volumes --output text| grep available | awk '{print $8}'`; do | |
echo "Deleting volume $volume" | |
aws ec2 delete-volume --volume-id $volume | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment