Skip to content

Commit

Permalink
add static IP reservation to ganymede create script
Browse files Browse the repository at this point in the history
  • Loading branch information
delgadom committed Dec 18, 2019
1 parent 757ef8b commit 6beb187
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion deploy/create_scripts/ganymede.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ set -e
# environment variables for this URL. If one does not exist, create the
# OAuth app using github organization oauth settings.

# Make sure you're logged in to gcloud and have the correct permissions
# Make sure you're logged in to gcloud and have the correct permissions, and that
# your current account is the one you would like to use for this cluster


EMAIL=$(gcloud config get-value account)
PROJECTID=$(gcloud config get-value project)
REGION=$(gcloud config get-value compute/region)
ZONE=$(gcloud config get-value compute/zone)
CLUSTER_NAME=ganymede
DEPLOYMENT_NAME=ganymede
Expand Down Expand Up @@ -124,6 +128,11 @@ sleep 120
echo; echo "retrieving external IP"
EXTERNAL_IP=$(kubectl -n ${CLUSTER_NAME} get service proxy-public -o wide | awk '{print $4}' | tail -n1)

# Reserve static IP
gcloud compute addresses create ${CLUSTER_NAME} \
--addresses ${EXTERNAL_IP} \
--region ${REGION}

# Modify DNS record set to direct cluster URL to proxy IP
if [[ "${DNS_ZONE}"!="" ]]; then
echo; echo "updating DNS record set for ${DNS_ZONE}"
Expand Down

0 comments on commit 6beb187

Please sign in to comment.