This commit is contained in:
Misty Stanley-Jones 2016-09-28 14:25:04 -07:00
parent e9de6f2a44
commit d4f01b812c
31 changed files with 2000 additions and 0 deletions

10
docs/container/confd.toml Normal file
View file

@ -0,0 +1,10 @@
backend = "etcd"
client_cakeys = "/ca/etcd/cert.pem"
client_cert = "/ca/etcd/cert.pem"
client_key = "/ca/etcd/key.pem"
confdir = "/etc/confd"
log-level = "info"
interval = 600
noop = false
scheme = "http"
watch = true

View file

@ -0,0 +1,21 @@
[template]
# The name of the template that will be used to render the application's configuration file
# Confd will look in `/etc/conf.d/templates` for these files by default
src = "garant.tmpl"
# The location to place the rendered configuration file
dest = "/config/garant.yml"
# The etcd keys or directory to watch. This is where the information to fill in
# the template will come from.
keys = [ "/dtr/configs/garant.yml" ]
# File ownership and mode information
owner = "root"
mode = "0644"
# These are the commands that will be used to check whether the rendered config is
# valid and to reload the actual service once the new config is in place
# TODO: can registry configs be reloaded without restarting thee container?
reload_cmd = "killall -USR2 registry"

View file

@ -0,0 +1,21 @@
[template]
# The name of the template that will be used to render the application's configuration file
# Confd will look in `/etc/conf.d/templates` for these files by default
src = "signing_key.tmpl"
# The location to place the rendered configuration file
dest = "/config/signing_key.json"
# The etcd keys or directory to watch. This is where the information to fill in
# the template will come from.
keys = [ "/dtr/configs/generatedConfigs/signing_key.json" ]
# File ownership and mode information
owner = "root"
mode = "0644"
# These are the commands that will be used to check whether the rendered config is
# valid and to reload the actual service once the new config is in place
# TODO: can registry configs be reloaded without restarting thee container?
reload_cmd = "killall -USR2 registry"

View file

@ -0,0 +1,21 @@
[template]
# The name of the template that will be used to render the application's configuration file
# Confd will look in `/etc/conf.d/templates` for these files by default
src = "storage.tmpl"
# The location to place the rendered configuration file
dest = "/config/storage.yml"
# The etcd keys or directory to watch. This is where the information to fill in
# the template will come from.
keys = [ "/dtr/configs/storage.yml" ]
# File ownership and mode information
owner = "root"
mode = "0644"
# These are the commands that will be used to check whether the rendered config is
# valid and to reload the actual service once the new config is in place
# TODO: can registry configs be reloaded without restarting thee container?
reload_cmd = "killall -USR2 registry"

View file

@ -0,0 +1,21 @@
[template]
# The name of the template that will be used to render the application's configuration file
# Confd will look in `/etc/conf.d/templates` for these files by default
src = "token_roots.tmpl"
# The location to place the rendered configuration file
dest = "/config/token_roots.pem"
# The etcd keys or directory to watch. This is where the information to fill in
# the template will come from.
keys = [ "/dtr/configs/generatedConfigs/token_roots.pem" ]
# File ownership and mode information
owner = "root"
mode = "0644"
# These are the commands that will be used to check whether the rendered config is
# valid and to reload the actual service once the new config is in place
# TODO: can registry configs be reloaded without restarting thee container?
reload_cmd = "killall -USR2 registry"

21
docs/container/start.sh Executable file
View file

@ -0,0 +1,21 @@
#!/bin/sh
echo "[starter] starting..."
# Fail hard and fast
set -eo pipefail
# If this fails, docker will restart the container. Yay, docker.
confd -node https://dtr-etcd-${DTR_REPLICA_ID}.dtr-br:2379 -node https://dtr-etcd-${DTR_REPLICA_ID}.dtr-br:4001 -onetime -config-file /etc/confd/confd.toml
# Run confd watcher in the background to watch the upstream servers
confd -node https://dtr-etcd-${DTR_REPLICA_ID}.dtr-br:2379 -node https://dtr-etcd-${DTR_REPLICA_ID}.dtr-br:4001 -config-file /etc/confd/confd.toml &
echo "[starter] confd is listening for changes on etcd..."
# Start registry
echo "[starter] starting registry service..."
while true
do
/bin/registry || true
sleep 1
done

View file

@ -0,0 +1 @@
{{getv "/dtr/configs/garant.yml"}}

View file

@ -0,0 +1 @@
{{getv "/dtr/configs/generatedConfigs/signing_key.json"}}

View file

@ -0,0 +1 @@
{{getv "/dtr/configs/storage.yml"}}

View file

@ -0,0 +1 @@
{{getv "/dtr/configs/generatedConfigs/token_roots.pem"}}