Skip to content

Commit

Permalink
Add a script to cleanup leaked kubeflow-ci ingress resources (kubeflo…
Browse files Browse the repository at this point in the history
…w#1199)

* Add a script to cleanup kubeflowci resources

* address comments
  • Loading branch information
Ankush Agarwal authored and k8s-ci-robot committed Jul 14, 2018
1 parent 2b33a5b commit 4320841
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions scripts/cleanup_kubeflow_ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
# This script cleans up ingress related compute engine resources like backend-services,
# forwarding rules, health-checks, etc. from kubeflow-ci project which
# do not belong to the kubeflow-testing cluster

set -xe

PROJECT="kubeflow-ci"

# This id comes from ingress objects in kubeflow-testing cluster
# They use a common suffix for GCP resources
KUBEFLOW_TESTING_ID=c3cb19bff97cde34

function cleanup() {
gcloud compute ${1} list --project=${PROJECT} \
| grep -v ${KUBEFLOW_TESTING_ID} \
| awk '{print $1}' \
| tail -n +2 \
| xargs gcloud compute ${1} delete ${2} --quiet --project=${PROJECT}
}

cleanup forwarding-rules --global

cleanup target-http-proxies

cleanup target-https-proxies

cleanup url-maps

cleanup health-checks

cleanup backend-services --global

0 comments on commit 4320841

Please sign in to comment.