Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

[solo] Fix skydns - two wrongs make a right #899

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions solo/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ FROM ubuntu:trusty

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get install --no-install-recommends -y curl dnsutils zookeeper git mercurial \
&& apt-get install --no-install-recommends -y curl dnsutils zookeeper git mercurial unbound \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

ADD unbound-to-skydns.conf /etc/unbound/unbound-to-skydns.conf
ADD skydns-to-unbound.conf /etc/unbound/skydns-to-unbound.conf

# Install helios-skydns plugin
ENV SKYDNS_PLUGIN_VERSION 0.1
ENV SKYDNS_PLUGIN_DEB helios-skydns_${SKYDNS_PLUGIN_VERSION}_all.deb
Expand All @@ -14,7 +17,7 @@ RUN curl -o $SKYDNS_PLUGIN_DEB -L $SKYDNS_PLUGIN_DEB_URI \
&& rm $SKYDNS_PLUGIN_DEB

# Install Go (from the official golang Dockerfile)
ENV GOLANG_VERSION 1.4.2
ENV GOLANG_VERSION 1.6
ENV PATH /go/bin:/usr/local/go/bin:$PATH
ENV GOPATH /go

Expand Down
13 changes: 13 additions & 0 deletions solo/base/skydns-to-unbound.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
server:
interface: 0.0.0.0
interface: ::0
port: 5454
tcp-upstream: no
num-threads: 1
incoming-num-tcp: 256
outgoing-num-tcp: 256
access-control: 0.0.0.0/0 allow
do-not-query-localhost: no

forward-zone:
name: "."
14 changes: 14 additions & 0 deletions solo/base/unbound-to-skydns.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
server:
interface: 0.0.0.0
interface: ::0
port: 53
tcp-upstream: yes
num-threads: 1
incoming-num-tcp: 256
outgoing-num-tcp: 256
access-control: 0.0.0.0/0 allow
do-not-query-localhost: no

forward-zone:
name: "."
forward-addr: "127.0.0.1@5353"
2 changes: 1 addition & 1 deletion solo/base/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4
0.6
2 changes: 1 addition & 1 deletion solo/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM spotify/helios-solo-base:0.4
FROM spotify/helios-solo-base:0.6

EXPOSE 5801

Expand Down
12 changes: 10 additions & 2 deletions solo/docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SKYDNS_PATH=$(echo $HELIOS_NAME|python -c "import sys;h=sys.stdin.read().strip()
# Write skydns configuration and retry for 30 seconds until successful
for i in {1..30}; do
if curl --retry 30 -XPUT http://127.0.0.1:4001/v2/keys/skydns/config \
-d value="{\"dns_addr\":\"0.0.0.0:53\", \"ttl\":3600, \"nameservers\": $NAMESERVERS, \"domain\":\"local.\"}"; then
-d value="{\"dns_addr\":\"0.0.0.0:5353\", \"ttl\":3600, \"nameservers\": ["127.0.0.1:5454"], \"domain\":\"local.\"}"; then
break
fi
sleep 1
Expand All @@ -23,7 +23,15 @@ done
curl -XPUT http://127.0.0.1:4001/v2/keys/skydns/${SKYDNS_PATH} \
-d value="{\"host\":\"$HOST_ADDRESS\"}"

skydns $SKYDNS_OPTS &
skydns $SKYDNS_OPTS -verbose &
unbound -c /etc/unbound/unbound-to-skydns.conf

# Take the upstream DNS resolvers from /etc/resolv.conf and tell our
# second unbound to forward to them.
for upstream in $(echo $NAMESERVERS | tr -d '[],' | tr ':' '@'); do
echo " forward-addr: ${upstream}" >> /etc/unbound/skydns-to-unbound.conf
done
unbound -c /etc/unbound/skydns-to-unbound.conf

/usr/share/zookeeper/bin/zkServer.sh start

Expand Down