forked from kubeflow/kubeflow
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a script to cleanup leaked kubeflow-ci ingress resources (kubeflo…
…w#1199) * Add a script to cleanup kubeflowci resources * address comments
- Loading branch information
1 parent
2b33a5b
commit 4320841
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
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 |