mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 10:19:50 +00:00
Switch Phabricator to use service accounts.
This commit is contained in:
parent
d7834f5033
commit
63c115f068
@ -140,7 +140,7 @@ To automate this process and make sure that a proper host is authorized even if
|
|||||||
"containers": [
|
"containers": [
|
||||||
{
|
{
|
||||||
"name": "authenticator",
|
"name": "authenticator",
|
||||||
"image": "fgrzadkowski/example-cloudsql-authenticator"
|
"image": "gcr.io.google_containers/cloudsql-authenticator:v1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"containers": [
|
"containers": [
|
||||||
{
|
{
|
||||||
"name": "authenticator",
|
"name": "authenticator",
|
||||||
"image": "fgrzadkowski/example-cloudsql-authenticator"
|
"image": "gcr.io/google_containers/cloudsql-authenticator:v1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -18,10 +18,13 @@
|
|||||||
# should only send updates if something changes. We should be able to do
|
# should only send updates if something changes. We should be able to do
|
||||||
# this by comparing pod creation time with the last scan time.
|
# this by comparing pod creation time with the last scan time.
|
||||||
while true; do
|
while true; do
|
||||||
hostport="${KUBERNETES_RO_SERVICE_HOST}:${KUBERNETES_RO_SERVICE_PORT}"
|
hostport="https://kubernetes.default.cluster.local"
|
||||||
path="api/v1beta1/pods"
|
token=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
|
||||||
|
path="api/v1beta3/pods"
|
||||||
query="labels=$SELECTOR"
|
query="labels=$SELECTOR"
|
||||||
ips_json=`curl ${hostport}/${path}?${query} 2>/dev/null | grep hostIP`
|
|
||||||
|
# TODO: load in the CAS cert when we distributed it on all platforms.
|
||||||
|
ips_json=`curl ${hostport}/${path}?${query} --insecure --header "Authorization: Bearer ${token}" 2>/dev/null | grep hostIP`
|
||||||
ips=`echo $ips_json | cut -d'"' -f 4 | sed 's/,$//'`
|
ips=`echo $ips_json | cut -d'"' -f 4 | sed 's/,$//'`
|
||||||
echo "Adding IPs $ips"
|
echo "Adding IPs $ips"
|
||||||
gcloud sql instances patch $CLOUDSQL_DB --authorized-networks $ips
|
gcloud sql instances patch $CLOUDSQL_DB --authorized-networks $ips
|
||||||
|
Loading…
Reference in New Issue
Block a user