Add Phabricator example

Summary: Add phabricator example

Reviewers: davidopp

Reviewed By: davidopp

Subscribers: #kubernetes

Projects: #kubernetes

Differential Revision: http://107.178.210.6/D5
This commit is contained in:
Filip Grzadkowski
2015-03-10 16:22:52 +01:00
parent a4d871a100
commit 401babef29
11 changed files with 354 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
#!/bin/bash
# TODO: This loop updates authorized networks even if nothing has changed. It
# should only send updates if something changes. We should be able to do
# this by comparing pod creation time with the last scan time.
while true; do
hostport="${KUBERNETES_RO_SERVICE_HOST}:${KUBERNETES_RO_SERVICE_PORT}"
path="api/v1beta1/pods"
query="labels=$SELECTOR"
ips_json=`curl ${hostport}/${path}?${query} 2>/dev/null | grep hostIP`
ips=`echo $ips_json | cut -d'"' -f 4 | sed 's/,$//'`
echo "Adding IPs $ips"
gcloud sql instances patch $CLOUDSQL_DB --authorized-networks $ips
sleep 10
done