Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
63c115f0
Commit
63c115f0
authored
May 18, 2015
by
Brendan Burns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch Phabricator to use service accounts.
parent
d7834f50
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
README.md
examples/phabricator/README.md
+1
-1
authenticator-controller.json
examples/phabricator/authenticator-controller.json
+1
-1
run.sh
examples/phabricator/cloudsql-authenticator/run.sh
+6
-3
No files found.
examples/phabricator/README.md
View file @
63c115f0
...
@@ -140,7 +140,7 @@ To automate this process and make sure that a proper host is authorized even if
...
@@ -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
"
}
}
]
]
}
}
...
...
examples/phabricator/authenticator-controller.json
View file @
63c115f0
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
"containers"
:
[
"containers"
:
[
{
{
"name"
:
"authenticator"
,
"name"
:
"authenticator"
,
"image"
:
"
fgrzadkowski/example-cloudsql-authenticator
"
"image"
:
"
gcr.io/google_containers/cloudsql-authenticator:v1
"
}
}
]
]
}
}
...
...
examples/phabricator/cloudsql-authenticator/run.sh
View file @
63c115f0
...
@@ -18,10 +18,13 @@
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment