mirror of
https://github.com/kelseyhightower/kubernetes-the-hard-way.git
synced 2025-12-16 17:58:57 +03:00
remove AWS support
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
# Cleaning Up
|
||||
|
||||
## GCP
|
||||
|
||||
### Virtual Machines
|
||||
## Virtual Machines
|
||||
|
||||
```
|
||||
gcloud -q compute instances delete \
|
||||
@@ -10,7 +8,7 @@ gcloud -q compute instances delete \
|
||||
worker0 worker1 worker2
|
||||
```
|
||||
|
||||
### Networking
|
||||
## Networking
|
||||
|
||||
```
|
||||
gcloud -q compute forwarding-rules delete kubernetes-forwarding-rule --region us-central1
|
||||
@@ -50,155 +48,4 @@ gcloud -q compute networks subnets delete kubernetes
|
||||
|
||||
```
|
||||
gcloud -q compute networks delete kubernetes-the-hard-way
|
||||
```
|
||||
|
||||
|
||||
## AWS
|
||||
|
||||
### Virtual Machines
|
||||
|
||||
```
|
||||
KUBERNETES_HOSTS=(controller0 controller1 controller2 worker0 worker1 worker2)
|
||||
```
|
||||
|
||||
```
|
||||
for host in ${KUBERNETES_HOSTS[*]}; do
|
||||
INSTANCE_ID=$(aws ec2 describe-instances \
|
||||
--filters "Name=tag:Name,Values=${host}" | \
|
||||
jq -j '.Reservations[].Instances[].InstanceId')
|
||||
aws ec2 terminate-instances --instance-ids ${INSTANCE_ID}
|
||||
done
|
||||
```
|
||||
|
||||
### IAM
|
||||
|
||||
```
|
||||
aws iam remove-role-from-instance-profile \
|
||||
--instance-profile-name kubernetes \
|
||||
--role-name kubernetes
|
||||
```
|
||||
|
||||
```
|
||||
aws iam delete-instance-profile \
|
||||
--instance-profile-name kubernetes
|
||||
```
|
||||
|
||||
```
|
||||
aws iam delete-role-policy \
|
||||
--role-name kubernetes \
|
||||
--policy-name kubernetes
|
||||
```
|
||||
|
||||
```
|
||||
aws iam delete-role --role-name kubernetes
|
||||
```
|
||||
|
||||
### SSH Keys
|
||||
|
||||
```
|
||||
aws ec2 delete-key-pair --key-name kubernetes
|
||||
```
|
||||
|
||||
### Networking
|
||||
|
||||
Be sure to wait about a minute for all VMs to terminates to avoid the following errors:
|
||||
|
||||
```
|
||||
An error occurred (DependencyViolation) when calling ...
|
||||
```
|
||||
|
||||
Network resources cannot be deleted while VMs hold a reference to them.
|
||||
|
||||
#### Load Balancers
|
||||
|
||||
```
|
||||
aws elb delete-load-balancer \
|
||||
--load-balancer-name kubernetes
|
||||
```
|
||||
|
||||
#### Internet Gateways
|
||||
|
||||
```
|
||||
VPC_ID=$(aws ec2 describe-vpcs \
|
||||
--filters "Name=tag:Name,Values=kubernetes" | \
|
||||
jq -r '.Vpcs[].VpcId')
|
||||
```
|
||||
|
||||
```
|
||||
INTERNET_GATEWAY_ID=$(aws ec2 describe-internet-gateways \
|
||||
--filters "Name=tag:Name,Values=kubernetes" | \
|
||||
jq -r '.InternetGateways[].InternetGatewayId')
|
||||
```
|
||||
|
||||
```
|
||||
aws ec2 detach-internet-gateway \
|
||||
--internet-gateway-id ${INTERNET_GATEWAY_ID} \
|
||||
--vpc-id ${VPC_ID}
|
||||
```
|
||||
|
||||
```
|
||||
aws ec2 delete-internet-gateway \
|
||||
--internet-gateway-id ${INTERNET_GATEWAY_ID}
|
||||
```
|
||||
|
||||
#### Security Groups
|
||||
|
||||
```
|
||||
SECURITY_GROUP_ID=$(aws ec2 describe-security-groups \
|
||||
--filters "Name=tag:Name,Values=kubernetes" | \
|
||||
jq -r '.SecurityGroups[].GroupId')
|
||||
```
|
||||
|
||||
```
|
||||
aws ec2 delete-security-group \
|
||||
--group-id ${SECURITY_GROUP_ID}
|
||||
```
|
||||
|
||||
#### Subnets
|
||||
|
||||
```
|
||||
SUBNET_ID=$(aws ec2 describe-subnets \
|
||||
--filters "Name=tag:Name,Values=kubernetes" | \
|
||||
jq -r '.Subnets[].SubnetId')
|
||||
```
|
||||
|
||||
```
|
||||
aws ec2 delete-subnet --subnet-id ${SUBNET_ID}
|
||||
```
|
||||
|
||||
#### Route Tables
|
||||
|
||||
```
|
||||
ROUTE_TABLE_ID=$(aws ec2 describe-route-tables \
|
||||
--filters "Name=tag:Name,Values=kubernetes" | \
|
||||
jq -r '.RouteTables[].RouteTableId')
|
||||
```
|
||||
|
||||
```
|
||||
aws ec2 delete-route-table --route-table-id ${ROUTE_TABLE_ID}
|
||||
```
|
||||
|
||||
#### VPC
|
||||
|
||||
```
|
||||
VPC_ID=$(aws ec2 describe-vpcs \
|
||||
--filters "Name=tag:Name,Values=kubernetes" | \
|
||||
jq -r '.Vpcs[].VpcId')
|
||||
```
|
||||
|
||||
```
|
||||
aws ec2 delete-vpc --vpc-id ${VPC_ID}
|
||||
```
|
||||
|
||||
#### DHCP Option Sets
|
||||
|
||||
```
|
||||
DHCP_OPTION_SET_ID=$(aws ec2 describe-dhcp-options \
|
||||
--filters "Name=tag:Name,Values=kubernetes" | \
|
||||
jq -r '.DhcpOptions[].DhcpOptionsId')
|
||||
```
|
||||
|
||||
```
|
||||
aws ec2 delete-dhcp-options \
|
||||
--dhcp-options-id ${DHCP_OPTION_SET_ID}
|
||||
```
|
||||
```
|
||||
Reference in New Issue
Block a user