introduce WEAVEDNS_DOCKER_ARGS
same purpuse as WEAVE_DOCKER_ARGS, except for weavedns This allows us to get rid if the -fallback option since WEAVEDNS_DOCKER_ARGS="--dns=..." has the same effect. Closes #487.
This commit is contained in:
1 parent
b50688b4de
commit
de557a3e03
2 files changed
+5
-13
No files matched your search
@@ -57,6 +57,7 @@ exec_remote() {
|
|||||||
-v "$PROCFS":/hostproc \
|
-v "$PROCFS":/hostproc \
|
||||||
-e VERSION \
|
-e VERSION \
|
||||||
-e WEAVE_DOCKER_ARGS \
|
-e WEAVE_DOCKER_ARGS \
|
||||||
|
-e WEAVEDNS_DOCKER_ARGS \
|
||||||
-e WEAVE_PASSWORD \
|
-e WEAVE_PASSWORD \
|
||||||
-e DOCKER_BRIDGE \
|
-e DOCKER_BRIDGE \
|
||||||
-e PROCFS=/hostproc --privileged --net=host \
|
-e PROCFS=/hostproc --privileged --net=host \
|
||||||
@@ -587,9 +588,12 @@ case "$COMMAND" in
|
|||||||
check_not_running $DNS_CONTAINER_NAME $BASE_DNS_IMAGE
|
check_not_running $DNS_CONTAINER_NAME $BASE_DNS_IMAGE
|
||||||
create_bridge
|
create_bridge
|
||||||
docker_bridge_ip
|
docker_bridge_ip
|
||||||
|
# Set WEAVEDNS_DOCKER_ARGS in the environment in order to supply
|
||||||
|
# additional parameters, such as resource limits, to docker
|
||||||
|
# when launching the weave container.
|
||||||
DNS_CONTAINER=$(docker run --privileged -d --name=$DNS_CONTAINER_NAME \
|
DNS_CONTAINER=$(docker run --privileged -d --name=$DNS_CONTAINER_NAME \
|
||||||
-p $DOCKER_BRIDGE_IP:53:53/udp -v /var/run/docker.sock:/var/run/docker.sock \
|
-p $DOCKER_BRIDGE_IP:53:53/udp -v /var/run/docker.sock:/var/run/docker.sock \
|
||||||
$DNS_IMAGE -iface $CONTAINER_IFNAME "$@")
|
$WEAVEDNS_DOCKER_ARGS $DNS_IMAGE -iface $CONTAINER_IFNAME "$@")
|
||||||
with_container_netns $DNS_CONTAINER attach $CIDR >/dev/null
|
with_container_netns $DNS_CONTAINER attach $CIDR >/dev/null
|
||||||
populate_dns
|
populate_dns
|
||||||
echo $DNS_CONTAINER
|
echo $DNS_CONTAINER
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/miekg/dns"
|
|
||||||
. "github.com/zettio/weave/common"
|
. "github.com/zettio/weave/common"
|
||||||
weavedns "github.com/zettio/weave/nameserver"
|
weavedns "github.com/zettio/weave/nameserver"
|
||||||
weavenet "github.com/zettio/weave/net"
|
weavenet "github.com/zettio/weave/net"
|
||||||
@@ -23,7 +22,6 @@ func main() {
|
|||||||
ifaceName string
|
ifaceName string
|
||||||
apiPath string
|
apiPath string
|
||||||
localDomain string
|
localDomain string
|
||||||
fallback string
|
|
||||||
dnsPort int
|
dnsPort int
|
||||||
httpPort int
|
httpPort int
|
||||||
wait int
|
wait int
|
||||||
@@ -42,7 +40,6 @@ func main() {
|
|||||||
flag.IntVar(&wait, "wait", 0, "number of seconds to wait for interface to be created and come up")
|
flag.IntVar(&wait, "wait", 0, "number of seconds to wait for interface to be created and come up")
|
||||||
flag.IntVar(&dnsPort, "dnsport", weavedns.DefaultServerPort, "port to listen to DNS requests")
|
flag.IntVar(&dnsPort, "dnsport", weavedns.DefaultServerPort, "port to listen to DNS requests")
|
||||||
flag.IntVar(&httpPort, "httpport", 6785, "port to listen to HTTP requests")
|
flag.IntVar(&httpPort, "httpport", 6785, "port to listen to HTTP requests")
|
||||||
flag.StringVar(&fallback, "fallback", "", "force a fallback (ie, '8.8.8.8:53') instead of /etc/resolv.conf values")
|
|
||||||
flag.IntVar(&timeout, "timeout", weavedns.DefaultTimeout, "timeout for resolutions")
|
flag.IntVar(&timeout, "timeout", weavedns.DefaultTimeout, "timeout for resolutions")
|
||||||
flag.IntVar(&udpbuf, "udpbuf", weavedns.DefaultUDPBuflen, "UDP buffer length")
|
flag.IntVar(&udpbuf, "udpbuf", weavedns.DefaultUDPBuflen, "UDP buffer length")
|
||||||
flag.IntVar(&cacheLen, "cache", weavedns.DefaultCacheLen, "cache length")
|
flag.IntVar(&cacheLen, "cache", weavedns.DefaultCacheLen, "cache length")
|
||||||
@@ -86,15 +83,6 @@ func main() {
|
|||||||
UDPBufLen: udpbuf,
|
UDPBufLen: udpbuf,
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(fallback) > 0 {
|
|
||||||
fallbackHost, fallbackPort, err := net.SplitHostPort(fallback)
|
|
||||||
if err != nil {
|
|
||||||
Error.Fatal("Could not parse fallback host and port", err)
|
|
||||||
}
|
|
||||||
srvConfig.UpstreamCfg = &dns.ClientConfig{Servers: []string{fallbackHost}, Port: fallbackPort}
|
|
||||||
Debug.Printf("DNS fallback at %s:%s", fallbackHost, fallbackPort)
|
|
||||||
}
|
|
||||||
|
|
||||||
srv, err := weavedns.NewDNSServer(srvConfig, zone, iface)
|
srv, err := weavedns.NewDNSServer(srvConfig, zone, iface)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Error.Fatal("Failed to initialize the WeaveDNS server", err)
|
Error.Fatal("Failed to initialize the WeaveDNS server", err)
|
||||||
|
|||||||
Reference in new issue
Block a user