ad gcloud scripts

This commit is contained in:
Mia Steinkirch 2018-06-17 21:53:40 -07:00 committed by GitHub
parent ce3251b9fe
commit 0402a432cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 43 additions and 0 deletions

View file

@ -0,0 +1,6 @@
#!/bin/bash
for x in $(gcloud projects list | tail -n +2 | awk '{ print $1}');
do
gcloud sql instances list --project $x
done

12
get_gae_apps.sh Normal file
View file

@ -0,0 +1,12 @@
#!/bin/bash
projects=$(gcloud projects list | tail -n +2 | awk '{ print $1}')
list_app () {
gcloud app services list --project $1 2>&1 | grep -v ERROR
}
for x in $projects;
do
list_app $x
done

9
get_kube_clusters.sh Normal file
View file

@ -0,0 +1,9 @@
#!/bin/bash
projects=$(gcloud projects list | tail -n +2 | awk '{ print $1}');
for x in $projects;
do
echo $x
gcloud container clusters list --project $x;
done

9
get_kube_master_ips.sh Normal file
View file

@ -0,0 +1,9 @@
#!/bin/bash
projects=$(gcloud projects list | tail -n +2 | awk '{ print $1}');
for x in $projects;
do
project_json=$(gcloud container clusters list --project $x --format json)
echo $project_json | jq -e -r '.[] | .endpoint'
done

7
get_public_ips.sh Normal file
View file

@ -0,0 +1,7 @@
#!/bin/bash
for x in $(gcloud projects list | tail -n +2 | awk '{ print $1}');
do
ip_list=$(gcloud compute instances list --project $x --format json)
gcloud compute instances list --project $x --format json | jq -r '.[] | .networkInterfaces[] | .accessConfigs[] | .natIP';
done