-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
e2e/docker: docker image for testing wildcard DNS
- Loading branch information
Anthony Romano
committed
Jul 22, 2017
1 parent
52dd13f
commit e9d5f75
Showing
8 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM golang:1.8.3-stretch | ||
LABEL Description="Image for etcd DNS testing" | ||
RUN apt update -y | ||
RUN go get github.com/mattn/goreman | ||
RUN apt install -y bind9 | ||
RUN mkdir /var/bind | ||
RUN chown bind /var/bind | ||
ADD Procfile.tls /Procfile.tls | ||
ADD run.sh /run.sh | ||
ADD named.conf etcd.zone rdns.zone /etc/bind/ | ||
ADD resolv.conf /etc/resolv.conf | ||
CMD ["/run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# run makefile from repo root | ||
|
||
docker-dns-build: | ||
docker build -t etcd-dns e2e/docker/ | ||
|
||
docker-dns-test: docker-dns-build | ||
docker run --dns 127.0.0.1 --rm -v `pwd`/bin/:/etcd -v `pwd`/integration/fixtures:/certs -w /etcd -t etcd-dns |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Use goreman to run `go get github.com/mattn/goreman` | ||
etcd1: ./etcd --name infra1 --listen-client-urls https://127.0.0.1:2379 --advertise-client-urls https://m1.etcd.local:2379 --listen-peer-urls https://127.0.0.1:12380 --initial-advertise-peer-urls=https://m1.etcd.local:12380 --initial-cluster-token etcd-cluster-1 --initial-cluster=infra1=https://m1.etcd.local:12380,infra2=https://m2.etcd.local:22380,infra3=https://m3.etcd.local:32380 --initial-cluster-state new --enable-pprof --peer-cert-file=/certs/server-wildcard.crt --peer-key-file=/certs/server-wildcard.key.insecure --peer-client-cert-auth --cert-file=/certs/server-wildcard.crt --key-file=/certs/server-wildcard.key.insecure --peer-trusted-ca-file=/certs/ca.crt --trusted-ca-file=/certs/ca.crt | ||
|
||
etcd2: ./etcd --name infra2 --listen-client-urls https://127.0.0.1:22379 --advertise-client-urls https://m2.etcd.local:22379 --listen-peer-urls https://127.0.0.1:22380 --initial-advertise-peer-urls=https://m2.etcd.local:22380 --initial-cluster-token etcd-cluster-1 --initial-cluster=infra1=https://m1.etcd.local:12380,infra2=https://m2.etcd.local:22380,infra3=https://m3.etcd.local:32380 --initial-cluster-state new --enable-pprof --peer-cert-file=/certs/server-wildcard.crt -peer-key-file=/certs/server-wildcard.key.insecure --peer-client-cert-auth --cert-file=/certs/server-wildcard.crt --key-file=/certs/server-wildcard.key.insecure --peer-trusted-ca-file=/certs/ca.crt --trusted-ca-file=/certs/ca.crt | ||
|
||
etcd3: ./etcd --name infra3 --listen-client-urls https://127.0.0.1:32379 --advertise-client-urls https://m3.etcd.local:32379 --listen-peer-urls https://127.0.0.1:32380 --initial-advertise-peer-urls=https://m3.etcd.local:32380 --initial-cluster-token etcd-cluster-1 --initial-cluster=infra1=https://m1.etcd.local:12380,infra2=https://m2.etcd.local:22380,infra3=https://m3.etcd.local:32380 --initial-cluster-state new --enable-pprof --peer-cert-file=/certs/server-wildcard.crt --peer-key-file=/certs/server-wildcard.key.insecure --peer-client-cert-auth --cert-file=/certs/server-wildcard.crt --key-file=/certs/server-wildcard.key.insecure --peer-trusted-ca-file=/certs/ca.crt --trusted-ca-file=/certs/ca.crt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
$TTL 86400 | ||
@ IN SOA etcdns.local. root.etcdns.local. ( | ||
100500 ; Serial | ||
604800 ; Refresh | ||
86400 ; Retry | ||
2419200 ; Expire | ||
86400 ) ; Negative Cache TTL | ||
IN NS ns.etcdns.local. | ||
IN A 127.0.0.1 | ||
|
||
ns IN A 127.0.0.1 | ||
m1 IN A 127.0.0.1 | ||
m2 IN A 127.0.0.1 | ||
m3 IN A 127.0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
options { | ||
directory "/var/bind"; | ||
listen-on { 127.0.0.1; }; | ||
listen-on-v6 { none; }; | ||
allow-transfer { | ||
none; | ||
}; | ||
// If you have problems and are behind a firewall: | ||
query-source address * port 53; | ||
pid-file "/var/run/named/named.pid"; | ||
allow-recursion { none; }; | ||
recursion no; | ||
}; | ||
|
||
zone "etcd.local" IN { | ||
type master; | ||
file "/etc/bind/etcd.zone"; | ||
}; | ||
|
||
zone "0.0.127.in-addr.arpa" { | ||
type master; | ||
file "/etc/bind/rdns.zone"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$TTL 86400 | ||
@ IN SOA etcdns.local. root.etcdns.local. ( | ||
100500 ; Serial | ||
604800 ; Refresh | ||
86400 ; Retry | ||
2419200 ; Expire | ||
86400 ) ; Negative Cache TTL | ||
IN NS ns.etcdns.local. | ||
IN A 127.0.0.1 | ||
|
||
1 IN PTR m1.etcd.local. | ||
1 IN PTR m2.etcd.local. | ||
1 IN PTR m3.etcd.local. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nameserver 127.0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
|
||
/etc/init.d/bind9 start | ||
# get rid of hosts so go lookup won't resolve 127.0.0.1 to localhost | ||
cat /dev/null >/etc/hosts | ||
goreman -f /Procfile.tls start & | ||
sleep 5s | ||
ETCDCTL_API=3 ./etcdctl --cacert=/certs/ca.crt --endpoints=https://m1.etcd.local:2379 put abc def |