Skip to content

Instantly share code, notes, and snippets.

@mesmacosta
Created July 19, 2020 18:17
Show Gist options
  • Select an option

  • Save mesmacosta/93918da94fa6a099dc25366c1d30dc4c to your computer and use it in GitHub Desktop.

Select an option

Save mesmacosta/93918da94fa6a099dc25366c1d30dc4c to your computer and use it in GitHub Desktop.
# Variables
INSTANCE_IP=$(curl -s api.ipify.org)
INSTANCE_CIDR=$INSTANCE_IP/32
ARRAY=("https-api-remote-k8s-local" "ssh-external-to-master-remote-k8s-local" "ssh-external-to-node-remote-k8s-local")
for item in ${ARRAY[@]}
do
echo "Updating firewall-rule $item source-range to $INSTANCE_CIDR"
gcloud compute firewall-rules update $item --source-ranges=$INSTANCE_CIDR
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment