Skip to content

Commit ed5435d

Browse files
author
Matthew Fisher
committed
Merge pull request #3361 from bacongobbler/bump-confd-0.8-controller
chore(controller): bump confd to v0.8
2 parents 24d7d6a + 898a10d commit ed5435d

6 files changed

Lines changed: 24 additions & 39 deletions

File tree

controller/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RUN curl -sSL -o /usr/local/bin/etcdctl https://s3-us-west-2.amazonaws.com/opdem
1010
&& chmod +x /usr/local/bin/etcdctl
1111

1212
# install confd
13-
RUN curl -sSL -o /usr/local/bin/confd https://s3-us-west-2.amazonaws.com/opdemand/confd-v0.5.0-json \
13+
RUN curl -sSL -o /usr/local/bin/confd https://github.com/kelseyhightower/confd/releases/download/v0.8.0/confd-0.8.0-linux-amd64 \
1414
&& chmod +x /usr/local/bin/confd
1515

1616
# define execution environment

controller/bin/boot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ etcd_safe_mkdir /deis/domains
5757
etcd_safe_mkdir /deis/platform
5858

5959
# wait for confd to run once and install initial templates
60-
until confd -onetime -node $ETCD -config-file /app/confd.toml 2>/dev/null; do
60+
until confd -onetime -node $ETCD --confdir /app --interval 5 --quiet 2>/dev/null; do
6161
echo "controller: waiting for confd to write initial templates..."
6262
sleep $(($ETCD_TTL/2)) # sleep for half the TTL
6363
done
@@ -83,7 +83,7 @@ function on_exit() {
8383
trap on_exit TERM
8484

8585
# spawn confd in the background to update services based on etcd changes
86-
confd -node $ETCD -config-file /app/confd.toml &
86+
confd -node $ETCD --confdir /app --interval 5 --quiet &
8787
CONFD_PID=$!
8888

8989
echo deis-controller running...

controller/bin/check

Lines changed: 0 additions & 8 deletions
This file was deleted.

controller/conf.d/confd_settings.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ keys = [
1111
"/deis/domains",
1212
"/deis/platform",
1313
]
14-
check_cmd = "/app/bin/check {{ .src }}"
1514
reload_cmd = "/app/bin/reload"

controller/confd.toml

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,47 @@
11
# security keys and auth tokens
2-
SECRET_KEY = '{{ .deis_controller_secretKey }}'
3-
BUILDER_KEY = '{{ .deis_controller_builderKey }}'
2+
SECRET_KEY = '{{ getv "/deis/controller/secretKey" }}'
3+
BUILDER_KEY = '{{ getv "/deis/controller/builderKey" }}'
44

55
# scheduler settings
6-
SCHEDULER_MODULE = 'scheduler.{{ or (.deis_controller_schedulerModule) "fleet" }}'
7-
SCHEDULER_TARGET = '{{ or (.deis_controller_schedulerTarget) "/var/run/fleet.sock" }}'
6+
SCHEDULER_MODULE = 'scheduler.{{ if exists "/deis/controller/schedulerModule" }}{{ getv "/deis/controller/schedulerModule" }}{{ else }}fleet{{ end }}'
7+
SCHEDULER_TARGET = '{{ if exists "/deis/controller/schedulerTarget" }}{{ getv "/deis/controller/schedulerTarget" }}{{ else }}/var/run/fleet.sock{{ end }}'
88
try:
9-
SCHEDULER_OPTIONS = dict('{{ or (.deis_controller_schedulerOptions) "{}" }}')
9+
SCHEDULER_OPTIONS = dict('{{ if exists "/deis/controller/schedulerOptions" }}{{ getv "/deis/controller/schedulerOptions" }}{{ else }}{}{{ end }}')
1010
except:
1111
SCHEDULER_OPTIONS = {}
1212

1313
# base64-encoded SSH private key to facilitate current version of "deis run"
14-
SSH_PRIVATE_KEY = """{{ or (.deis_platform_sshPrivateKey) "" }}"""
14+
SSH_PRIVATE_KEY = """{{ if exists "/deis/platform/sshPrivateKey" }}{{ getv "/deis/platform/sshPrivateKey" }}{{ else }}""{{end}}"""
1515

1616
# platform domain must be provided
17-
DEIS_DOMAIN = '{{ .deis_platform_domain }}'
17+
DEIS_DOMAIN = '{{ getv "/deis/platform/domain" }}'
1818

1919
# use the private registry module
2020
REGISTRY_MODULE = 'registry.private'
21-
REGISTRY_URL = '{{ .deis_registry_protocol }}://{{ .deis_registry_host }}:{{ .deis_registry_port }}' # noqa
22-
REGISTRY_HOST = '{{ .deis_registry_host }}'
23-
REGISTRY_PORT = '{{ .deis_registry_port }}'
21+
REGISTRY_URL = '{{ getv "/deis/registry/protocol" }}://{{ getv "/deis/registry/host" }}:{{ getv "/deis/registry/port" }}' # noqa
22+
REGISTRY_HOST = '{{ getv "/deis/registry/host" }}'
23+
REGISTRY_PORT = '{{ getv "/deis/registry/port" }}'
2424

2525
# default to sqlite3, but allow postgresql config through envvars
2626
DATABASES = {
2727
'default': {
28-
'ENGINE': 'django.db.backends.{{ .deis_database_engine }}',
29-
'NAME': '{{ .deis_database_name }}',
30-
'USER': '{{ .deis_database_user }}',
31-
'PASSWORD': '{{ .deis_database_password }}',
32-
'HOST': '{{ .deis_database_host }}',
33-
'PORT': '{{ .deis_database_port }}',
28+
'ENGINE': 'django.db.backends.{{ getv "/deis/database/engine" }}',
29+
'NAME': '{{ getv "/deis/database/name" }}',
30+
'USER': '{{ getv "/deis/database/user" }}',
31+
'PASSWORD': '{{ getv "/deis/database/password" }}',
32+
'HOST': '{{ getv "/deis/database/host" }}',
33+
'PORT': '{{ getv "/deis/database/port" }}',
3434
}
3535
}
3636

3737
# move log directory out of /app/deis
3838
DEIS_LOG_DIR = '/data/logs'
3939

40-
{{ if .deis_controller_registrationEnabled }}
41-
REGISTRATION_ENABLED = bool({{ .deis_controller_registrationEnabled }})
40+
{{ if exists "/deis/controller/registrationEnabled" }}
41+
REGISTRATION_ENABLED = bool({{ getv "/deis/controller/registrationEnabled" }})
4242
{{ end }}
4343

44-
{{ if .deis_controller_webEnabled }}
45-
WEB_ENABLED = bool({{ .deis_controller_webEnabled }})
44+
{{ if exists "/deis/controller/webEnabled" }}
45+
WEB_ENABLED = bool({{ getv "/deis/controller/webEnabled" }})
4646
{{ end }}
47-
48-
UNIT_HOSTNAME = '{{ or (.deis_controller_unitHostname) "default" }}'
47+
UNIT_HOSTNAME = '{{ if exists "/deis/controller/unitHostname" }}{{ getv "/deis/controller/unitHostname" }}{{ else }}default{{ end }}'

0 commit comments

Comments
 (0)