-
Notifications
You must be signed in to change notification settings - Fork 0
/
clean.sh
24 lines (18 loc) · 974 Bytes
/
clean.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
#!/bin/bash
export PROJECT_ID=speedy-victory-336109
export GKE_CLUSTER_NAME=my-gke
export REDIS_CLUSTER_NAME=sd-redis
export REGION=asia-southeast1
export ZONE=asia-southeast1-a
export FILESTORE_NAME=sd-filestore
export TOPIC_NAME=sd-topic
echo "Deleting k8s resource ..."
gcloud container clusters delete ${GKE_CLUSTER_NAME} --project ${PROJECT_ID} --region ${REGION} --async --quiet > /dev/null
echo "Deleting Pub/Sub resource ..."
gcloud pubsub subscriptions delete ${TOPIC_NAME}-sub --project ${PROJECT_ID} > /dev/null
gcloud pubsub topics delete ${TOPIC_NAME} --project ${PROJECT_ID} > /dev/null
echo "Deleting Redis ..."
gcloud redis instances delete ${REDIS_CLUSTER_NAME} --region ${REGION} --project ${PROJECT_ID} --async --quiet > /dev/null
echo "Deleting Filestore ..."
gcloud filestore instances delete ${FILESTORE_NAME} --project=${PROJECT_ID} --location=${ZONE} --async --quiet > /dev/null
echo "Completed, the resource is being deleted asynchronously."