2017-01-27 03:23:42 +03:00
|
|
|
#!/usr/bin/env bash
|
2017-01-17 08:39:03 +03:00
|
|
|
set -x
|
|
|
|
|
|
|
|
if [[ -z ${NUM_CONTROLLERS} || -z ${NUM_WORKERS} ]]; then
|
|
|
|
echo "Must set NUM_CONTROLLERS and NUM_WORKERS env vars"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
(( NUM_CONTROLLERS-- ))
|
|
|
|
(( NUM_WORKERS-- ))
|
|
|
|
|
|
|
|
for i in $(eval echo "{0..${NUM_CONTROLLERS}}"); do
|
|
|
|
hosts="${hosts}controller${i} "
|
|
|
|
done
|
|
|
|
|
|
|
|
for i in $(eval echo "{0..${NUM_WORKERS}}"); do
|
|
|
|
hosts="${hosts}worker${i} "
|
|
|
|
done
|
|
|
|
|
|
|
|
gcloud -q compute instances delete ${hosts}
|
|
|
|
|
2017-01-20 21:42:53 +03:00
|
|
|
gcloud -q compute forwarding-rules delete kubernetes-rule --region us-central1
|
2017-01-17 08:39:03 +03:00
|
|
|
|
|
|
|
gcloud -q compute target-pools delete kubernetes-pool
|
|
|
|
|
|
|
|
gcloud -q compute http-health-checks delete kube-apiserver-check
|
|
|
|
|
|
|
|
gcloud -q compute addresses delete kubernetes
|
|
|
|
|
|
|
|
gcloud -q compute firewall-rules delete \
|
|
|
|
kubernetes-allow-api-server \
|
|
|
|
kubernetes-allow-healthz \
|
|
|
|
kubernetes-allow-icmp \
|
|
|
|
kubernetes-allow-internal \
|
2017-01-20 20:22:27 +03:00
|
|
|
kubernetes-allow-internal-podcidr \
|
2017-01-17 08:39:03 +03:00
|
|
|
kubernetes-allow-rdp \
|
|
|
|
kubernetes-allow-ssh \
|
|
|
|
kubernetes-nginx-service
|
|
|
|
|
|
|
|
for i in $(eval echo "{0..${NUM_WORKERS}}"); do
|
|
|
|
gcloud -q compute routes delete kubernetes-route-10-200-${i}-0-24
|
|
|
|
done
|
|
|
|
|
|
|
|
gcloud -q compute networks subnets delete kubernetes
|
|
|
|
|
|
|
|
gcloud -q compute networks delete kubernetes
|