Created
July 19, 2020 18:30
-
-
Save mesmacosta/8c4d2b661a669abf35450ed9ae7389f4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| set -euo pipefail | |
| source ./scripts/env.sh | |
| function join_by { local IFS="$1"; shift; echo "$*"; } | |
| ALL_CLUSTER_CIDRS=$(gcloud container clusters list --format='value(clusterIpv4Cidr)' | sort | uniq) | |
| ALL_CLUSTER_CIDRS=$(join_by , $(echo "${ALL_CLUSTER_CIDRS}")) | |
| ALL_CLUSTER_NETTAGS=$(gcloud compute instances list --format='value(tags.items.[0])' | sort | uniq) | |
| ALL_CLUSTER_NETTAGS=$(join_by , $(echo "${ALL_CLUSTER_NETTAGS}")) | |
| gcloud compute firewall-rules create istio-multicluster-test-pods \ | |
| --allow=tcp,udp,icmp,esp,ah,sctp \ | |
| --direction=INGRESS \ | |
| --priority=900 \ | |
| --source-ranges="${ALL_CLUSTER_CIDRS}" \ | |
| --target-tags="${ALL_CLUSTER_NETTAGS}" --quiet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment