Compare commits

...
26 Commits
Author SHA1 Message Date
Bryan Boreham ba266ef8d3 Add release v1.4.1 2015-12-22 17:25:47 +00:00
Bryan Boreham f434fad3be Merge pull request #1822 from weaveworks/1820-unix-only
Only pass $DOCKER_HOST if it is a Unix socket - fixes #1820
2015-12-22 17:16:40 +00:00
Bryan Boreham bab758ebf9 Revert "Launch the proxy via unix socket in last test"
- since we won't now be copying $DOCKER_HOST

This reverts commit d8cfbc4e08.
2015-12-22 17:01:04 +00:00
Bryan Boreham 800f4663b6 Only pass through $DOCKER_HOST in exec_remote() if it is a Unix socket;
a TCP socket may be secured by TLS, in which case we can't use it.
2015-12-22 17:01:04 +00:00
Matthias Radestock b1b62afa90 Merge pull request #1812 from weaveworks/1810-warn-with-dns
Issue a warning on --with-dns option to proxy, because it was removed

Fixes #1810
2015-12-22 15:12:27 +00:00
Bryan Boreham 6b90ef7078 Clarify message 2015-12-22 14:56:40 +00:00
Matthias Radestock 2ed4b45c24 Merge pull request #1817 from weaveworks/1815-docker-version
Check we have Docker 1.9 or newer before trying to remove a network

Fixes #1815.
2015-12-22 14:01:55 +00:00
Matthias Radestock 47ba9748b4 Merge pull request #1814 from weaveworks/1778-check-running
Handle weave containers in 'restarting' state

Fixes #1778.
2015-12-22 13:49:19 +00:00
Bryan Boreham 077ad4208f Merge pull request #1813 from weaveworks/1797-plugin-version
Show plugin version; Fixes #1797
2015-12-22 13:12:38 +00:00
Bryan Boreham c19edec364 Add 'weave stop-xxx' instructions for 'already running' case 2015-12-22 13:04:06 +00:00
Bryan Boreham 0c2aa494ae Reduce duplication 2015-12-22 13:03:04 +00:00
Bryan Boreham 73e0a6bb0a Inform user about weave containers in state 'restarting' 2015-12-22 13:01:00 +00:00
Bryan Boreham abf1db0045 Merge pull request #1819 from weaveworks/1818-dont-launch-when-plugin-running
don't launch anything when plugin is running; fixes #1818 . LGTM.
2015-12-22 12:55:57 +00:00
Matthias Radestock b40b78ece0 refactor docker_sock_volume_mount() 2015-12-22 12:47:36 +00:00
Matthias Radestock 3ade796e8d don't launch anything when plugin is running
...just as we don't launch anything if either the router or proxy are
running.

Fixes #1818.
2015-12-22 12:30:53 +00:00
Bryan Boreham 7c2e808924 Check we have Docker 1.9 or newer before trying to remove a network 2015-12-22 12:10:48 +00:00
Bryan Boreham 7d2227c5a4 Add plugin version to 'weave version' 2015-12-22 10:50:02 +00:00
Bryan Boreham 8a517d5c7c Issue a warning on --with-dns option to proxy, because it was removed 2015-12-22 10:00:06 +00:00
Bryan Boreham 48658f011f Merge pull request #1805 from weaveworks/script-indentation
Fix indentation of weave script
2015-12-18 09:53:12 +00:00
Bryan Boreham 4ebb13fa94 Fix indentation of netcheck if-statement 2015-12-17 16:23:42 +00:00
Adam Harrison ff9a6b91a4 Merge branch 'latest_release_doc_updates' into 1.4 2015-12-17 13:07:48 +00:00
Adam Harrison 86fc37a968 Merge pull request #1799 from weaveworks/plugin-docs
Extend plugin docs
2015-12-17 12:24:12 +00:00
Bryan Boreham 37ae169323 Merge remote-tracking branch 'origin/master' into latest_release_doc_updates 2015-12-17 11:48:23 +00:00
Bryan Boreham 1ce0df4e94 Explain multiple networks 2015-12-17 11:42:41 +00:00
Bryan Boreham db5ba61915 Improve formatting 2015-12-17 11:41:44 +00:00
Bryan Boreham 1d9ef76080 Remove mention of --with-dns option; see #1748 and #1754 2015-12-12 13:58:14 +00:00
6 changed files with 80 additions and 62 deletions

No files matched your search

+14
View File
@@ -1,3 +1,17 @@
## Release 1.4.1
This is a bug-fix release to cover a few issues that came up since the
release of 1.4.0.
* Weave would fail to launch when `$DOCKER_HOST` was set to a TCP socket secured with TLS #1820/#1822
* Weave would fail to stop when run against Docker pre-1.9 #1815/#1817
* Issue a warning instead of failing on `--with-dns` option to proxy, which was removed #1810/#1812
* Make `weave version` show the plugin version #1797/#1813
* Make `weave launch` show when the a container is restarting #1778/#1814
* Make `weave launch` fail if the plugin is running, for consistency with router and proxy. #1818/#1819
More details in the [change log](https://github.com/weaveworks/weave/issues?q=milestone%3A1.4.1).
## Release 1.4.0 ## Release 1.4.0
**Highlights** **Highlights**
+6
View File
@@ -21,6 +21,7 @@ func main() {
justVersion bool justVersion bool
logLevel = "info" logLevel = "info"
c = proxy.Config{Image: "weaveworks/weaveexec"} c = proxy.Config{Image: "weaveworks/weaveexec"}
withDNS bool
) )
c.Version = version c.Version = version
@@ -39,6 +40,7 @@ func main() {
mflag.BoolVar(&c.TLSConfig.Enabled, []string{"#tls", "-tls"}, false, "Use TLS; implied by --tlsverify") mflag.BoolVar(&c.TLSConfig.Enabled, []string{"#tls", "-tls"}, false, "Use TLS; implied by --tlsverify")
mflag.StringVar(&c.TLSConfig.Key, []string{"#tlskey", "-tlskey"}, "", "Path to TLS key file") mflag.StringVar(&c.TLSConfig.Key, []string{"#tlskey", "-tlskey"}, "", "Path to TLS key file")
mflag.BoolVar(&c.TLSConfig.Verify, []string{"#tlsverify", "-tlsverify"}, false, "Use TLS and verify the remote") mflag.BoolVar(&c.TLSConfig.Verify, []string{"#tlsverify", "-tlsverify"}, false, "Use TLS and verify the remote")
mflag.BoolVar(&withDNS, []string{"#-with-dns", "#w"}, false, "option removed")
mflag.BoolVar(&c.WithoutDNS, []string{"-without-dns"}, false, "instruct created containers to never use weaveDNS as their nameserver") mflag.BoolVar(&c.WithoutDNS, []string{"-without-dns"}, false, "instruct created containers to never use weaveDNS as their nameserver")
mflag.BoolVar(&c.NoMulticastRoute, []string{"-no-multicast-route"}, false, "do not add a multicast route via the weave interface when attaching containers") mflag.BoolVar(&c.NoMulticastRoute, []string{"-no-multicast-route"}, false, "do not add a multicast route via the weave interface when attaching containers")
mflag.Parse() mflag.Parse()
@@ -57,6 +59,10 @@ func main() {
Log.Infoln("weave proxy", version) Log.Infoln("weave proxy", version)
Log.Infoln("Command line arguments:", strings.Join(os.Args[1:], " ")) Log.Infoln("Command line arguments:", strings.Join(os.Args[1:], " "))
if withDNS {
Log.Warning("--with-dns option has been removed; DNS is on by default")
}
c.DockerHost = defaultDockerHost c.DockerHost = defaultDockerHost
if dockerHost := os.Getenv("DOCKER_HOST"); dockerHost != "" { if dockerHost := os.Getenv("DOCKER_HOST"); dockerHost != "" {
c.DockerHost = dockerHost c.DockerHost = dockerHost
+10 -3
View File
@@ -3,6 +3,8 @@ title: Using Weave Net via Docker Networking
layout: default layout: default
--- ---
# Weave Plugin
New in Docker version 1.9 is a plugin mechanism to add different New in Docker version 1.9 is a plugin mechanism to add different
network providers. network providers.
@@ -18,11 +20,11 @@ you remove this container (e.g. using `weave reset`) before removing
all endpoints created using `--net=weave`, Docker can all endpoints created using `--net=weave`, Docker can
[hang](https://github.com/docker/libnetwork/issues/813). [hang](https://github.com/docker/libnetwork/issues/813).
## Starting a container: ## Starting a container
$ docker run --net=weave -ti ubuntu $ docker run --net=weave -ti ubuntu
## Using WeaveDNS for Service Discovery: ## Using WeaveDNS for Service Discovery
You need to pass the additional arguments `--dns` and `-dns-search`, You need to pass the additional arguments `--dns` and `-dns-search`,
for which we provide a helper in the weave script: for which we provide a helper in the weave script:
@@ -46,6 +48,11 @@ store](#cluster-store) (like Docker's overlay driver) and one named
* Supports only a single network (we create one named `weave` for you automatically) * Supports only a single network (we create one named `weave` for you automatically)
* Uses Weave's partition tolerant IPAM * Uses Weave's partition tolerant IPAM
If you do create additional networks using the `weavemesh` driver,
containers attached to them will be able to communicate with
containers attached to `weave`; there is no isolation between those
networks.
### `weave` driver ### `weave` driver
* This runs in what Docker call "global scope"; requires a cluster store * This runs in what Docker call "global scope"; requires a cluster store
@@ -56,7 +63,7 @@ There's no specific documentation from Docker on using a cluster
store, but the first part of [Getting Started with Docker Multi-host Networking][docker-net] store, but the first part of [Getting Started with Docker Multi-host Networking][docker-net]
should point the way. should point the way.
Note that in the case of multiple docker networks, all containers are Note that in the case of multiple networks using the `weave` driver, all containers are
on the same virtual network but Docker allocates their addresses on on the same virtual network but Docker allocates their addresses on
different subnets so they cannot talk to each other directly. different subnets so they cannot talk to each other directly.
+3 -4
View File
@@ -55,9 +55,8 @@ root@ubuntu:/# ping pingme
> the hostname is not in the weaveDNS domain the container will *not* > the hostname is not in the weaveDNS domain the container will *not*
> be registered, but will still use weaveDNS for resolution. > be registered, but will still use weaveDNS for resolution.
It is also possible to force or forbid an application container's use To disable application containers' use of weaveDNS, add the
of weaveDNS with the `--with-dns` and `--without-dns` options to `--without-dns` option to `weave run` or `weave launch-proxy`.
`weave run` and `weave launch-proxy`.
## <a name="how-it-works"></a>How it works ## <a name="how-it-works"></a>How it works
@@ -100,7 +99,7 @@ In the event that weaveDNS is launched in this way, it's important that
other calls to `weave` also specify the bridge device: other calls to `weave` also specify the bridge device:
```bash ```bash
$ sudo DOCKER_BRIDGE=someother weave run --with-dns ... $ sudo DOCKER_BRIDGE=someother weave run ...
``` ```
## <a name="load-balancing"></a>Load balancing ## <a name="load-balancing"></a>Load balancing
+1 -1
View File
@@ -30,7 +30,7 @@ check
# Check we can use weave env/config with unix -Hs specified # Check we can use weave env/config with unix -Hs specified
weave_on $HOST1 stop weave_on $HOST1 stop
run_on $HOST1 "COVERAGE=$COVERAGE weave launch-proxy -H unix:///var/run/weave/weave.sock" weave_on $HOST1 launch-proxy -H unix:///var/run/weave/weave.sock
assert_raises "run_on $HOST1 'eval \$(weave env) ; docker $CMD'" assert_raises "run_on $HOST1 'eval \$(weave env) ; docker $CMD'"
assert_raises "run_on $HOST1 'docker \$(weave config) $CMD'" assert_raises "run_on $HOST1 'docker \$(weave config) $CMD'"
+46 -54
View File
@@ -95,25 +95,19 @@ usage() {
exit 1 exit 1
} }
docker_sock() { docker_sock_options() {
if [ -z "$DOCKER_HOST" ]; then # Pass through DOCKER_HOST if it is a Unix socket;
echo "/var/run/docker.sock" # a TCP socket may be secured by TLS, in which case we can't use it
return if echo "$DOCKER_HOST" | grep -q "^unix://" >/dev/null; then
fi echo "-v ${DOCKER_HOST#unix://}:${DOCKER_HOST#unix://} -e DOCKER_HOST"
if echo "$DOCKER_HOST" | grep -q "^unix://" >/dev/null; then else
echo "${DOCKER_HOST#unix://}" echo "-v /var/run/docker.sock:/var/run/docker.sock"
fi fi
}
docker_sock_volume_mount() {
if [ -n "$(docker_sock)" ]; then
echo "-v $(docker_sock):$(docker_sock)"
fi
} }
exec_remote() { exec_remote() {
docker $DOCKER_CLIENT_ARGS run --rm --privileged --net=host \ docker $DOCKER_CLIENT_ARGS run --rm --privileged --net=host \
$(docker_sock_volume_mount) \ $(docker_sock_options) \
-v /proc:/hostproc \ -v /proc:/hostproc \
-e PROCFS=/hostproc \ -e PROCFS=/hostproc \
-e DOCKERHUB_USER="$DOCKERHUB_USER" \ -e DOCKERHUB_USER="$DOCKERHUB_USER" \
@@ -128,7 +122,6 @@ exec_remote() {
-e WEAVE_NO_FASTDP \ -e WEAVE_NO_FASTDP \
-e WEAVE_NO_BRIDGED_FASTDP \ -e WEAVE_NO_BRIDGED_FASTDP \
-e WEAVE_NO_PLUGIN \ -e WEAVE_NO_PLUGIN \
-e DOCKER_HOST \
-e DOCKER_BRIDGE \ -e DOCKER_BRIDGE \
-e DOCKER_CLIENT_HOST="$DOCKER_CLIENT_HOST" \ -e DOCKER_CLIENT_HOST="$DOCKER_CLIENT_HOST" \
-e DOCKER_CLIENT_ARGS \ -e DOCKER_CLIENT_ARGS \
@@ -913,29 +906,27 @@ container_weave_addrs() {
# functions for interacting with containers # functions for interacting with containers
###################################################################### ######################################################################
# Check that a container named $1 with image $2 is not running # Check that a container for component $1 named $2 with image $3 is not running
check_not_running() { check_not_running() {
case $(docker inspect --format='{{.State.Running}} {{.Config.Image}}' $1 2>/dev/null) in RUN_STATUS=$(docker inspect --format='{{.State.Running}} {{.State.Status}} {{.Config.Image}}' $2 2>/dev/null) || true
"true $2") case ${RUN_STATUS%:*} in
echo "$1 is already running." >&2 "true restarting $3")
echo "$2 is restarting; you can stop it with 'weave stop-$1'." >&2
exit 1 exit 1
;; ;;
"true $2:"*) "true "*" $3")
echo "$1 is already running." >&2 echo "$2 is already running; you can stop it with 'weave stop-$1'." >&2
exit 1 exit 1
;; ;;
"false $2") "false "*" $3")
docker rm $1 >/dev/null docker rm $2 >/dev/null
;;
"false $2:"*)
docker rm $1 >/dev/null
;; ;;
true*) true*)
echo "Found another running container named '$1'. Aborting." >&2 echo "Found another running container named '$2'. Aborting." >&2
exit 1 exit 1
;; ;;
false*) false*)
echo "Found another container named '$1'. Aborting." >&2 echo "Found another container named '$2'. Aborting." >&2
exit 1 exit 1
;; ;;
esac esac
@@ -1604,14 +1595,14 @@ launch_router() {
if [ -z "$IPRANGE_SPECIFIED" ] ; then if [ -z "$IPRANGE_SPECIFIED" ] ; then
IPRANGE="10.32.0.0/12" IPRANGE="10.32.0.0/12"
if command_exists netcheck && ! netcheck --ignore-iface=$BRIDGE $IPRANGE ; then if command_exists netcheck && ! netcheck --ignore-iface=$BRIDGE $IPRANGE ; then
echo "ERROR: Default --ipalloc-range $IPRANGE overlaps with existing route on host." >&2 echo "ERROR: Default --ipalloc-range $IPRANGE overlaps with existing route on host." >&2
echo "You must pick another range and set it on all hosts." >&2 echo "You must pick another range and set it on all hosts." >&2
exit 1 exit 1
fi fi
else else
if [ -n "$IPRANGE" ] && command_exists netcheck && ! netcheck --ignore-iface=$BRIDGE $IPRANGE ; then if [ -n "$IPRANGE" ] && command_exists netcheck && ! netcheck --ignore-iface=$BRIDGE $IPRANGE ; then
echo "WARNING: Specified --ipalloc-range $IPRANGE overlaps with existing route on host." >&2 echo "WARNING: Specified --ipalloc-range $IPRANGE overlaps with existing route on host." >&2
echo "Unless this is deliberate, you must pick another range and set it on all hosts." >&2 echo "Unless this is deliberate, you must pick another range and set it on all hosts." >&2
fi fi
fi fi
@@ -1624,10 +1615,9 @@ launch_router() {
# additional parameters, such as resource limits, to docker # additional parameters, such as resource limits, to docker
# when launching the weave container. # when launching the weave container.
ROUTER_CONTAINER=$(docker run --privileged -d --name=$CONTAINER_NAME \ ROUTER_CONTAINER=$(docker run --privileged -d --name=$CONTAINER_NAME \
$(docker_sock_volume_mount) \ $(docker_sock_options) \
-p $PORT:$CONTAINER_PORT/tcp -p $PORT:$CONTAINER_PORT/udp \ -p $PORT:$CONTAINER_PORT/tcp -p $PORT:$CONTAINER_PORT/udp \
${NETHOST_OPT:-$DNS_PORT_MAPPING} \ ${NETHOST_OPT:-$DNS_PORT_MAPPING} \
-e DOCKER_HOST \
-e WEAVE_PASSWORD \ -e WEAVE_PASSWORD \
-e WEAVE_CIDR=none \ -e WEAVE_CIDR=none \
$WEAVE_DOCKER_ARGS $IMAGE $COVERAGE_ARGS \ $WEAVE_DOCKER_ARGS $IMAGE $COVERAGE_ARGS \
@@ -1682,12 +1672,11 @@ launch_proxy() {
mkdir -p /var/run/weave mkdir -p /var/run/weave
PROXY_CONTAINER=$(docker run --privileged -d --name=$PROXY_CONTAINER_NAME --net=host \ PROXY_CONTAINER=$(docker run --privileged -d --name=$PROXY_CONTAINER_NAME --net=host \
$PROXY_VOLUMES \ $PROXY_VOLUMES \
$(docker_sock_volume_mount) \ $(docker_sock_options) \
-v /var/run/weave:/var/run/weave \ -v /var/run/weave:/var/run/weave \
-v /proc:/hostproc \ -v /proc:/hostproc \
-e PROCFS=/hostproc \ -e PROCFS=/hostproc \
-e WEAVE_CIDR=none \ -e WEAVE_CIDR=none \
-e DOCKER_HOST \
-e DOCKER_BRIDGE \ -e DOCKER_BRIDGE \
-e WEAVE_DEBUG \ -e WEAVE_DEBUG \
-e COVERAGE \ -e COVERAGE \
@@ -1706,16 +1695,17 @@ launch_plugin() {
PLUGIN_CONTAINER=$(docker run --privileged -d --name=$PLUGIN_CONTAINER_NAME \ PLUGIN_CONTAINER=$(docker run --privileged -d --name=$PLUGIN_CONTAINER_NAME \
--restart=always \ --restart=always \
--net=host \ --net=host \
$(docker_sock_volume_mount) \ $(docker_sock_options) \
-v /run/docker/plugins:/run/docker/plugins \ -v /run/docker/plugins:/run/docker/plugins \
-e DOCKER_HOST \
$PLUGIN_IMAGE "$@") $PLUGIN_IMAGE "$@")
} }
remove_plugin_network() { remove_plugin_network() {
docker run --rm --net=host \ if [ -z $WEAVE_NO_PLUGIN ] && check_docker_server_api_version 1.21 ; then
-v /var/run/docker.sock:/var/run/docker.sock \ docker run --rm --net=host \
$PLUGIN_IMAGE --remove-network -v /var/run/docker.sock:/var/run/docker.sock \
$PLUGIN_IMAGE --remove-network
fi
} }
stop_plugin() { stop_plugin() {
@@ -1810,6 +1800,9 @@ deprecation_warnings() {
-no-default-ipam|--no-default-ipam) -no-default-ipam|--no-default-ipam)
deprecation_warning $1 "--no-default-ipalloc" deprecation_warning $1 "--no-default-ipalloc"
;; ;;
--with-dns)
echo "Warning: $1 has been removed; DNS is on by default" >&2
;;
esac esac
shift shift
done done
@@ -1829,6 +1822,7 @@ case "$COMMAND" in
[ $# -eq 0 ] || usage [ $# -eq 0 ] || usage
ask_version $CONTAINER_NAME $IMAGE || true ask_version $CONTAINER_NAME $IMAGE || true
ask_version $PROXY_CONTAINER_NAME $EXEC_IMAGE --entrypoint=/home/weave/weaveproxy || true ask_version $PROXY_CONTAINER_NAME $EXEC_IMAGE --entrypoint=/home/weave/weaveproxy || true
ask_version $PLUGIN_CONTAINER_NAME $PLUGIN_IMAGE || true
;; ;;
# intentionally undocumented since it assumes knowledge of weave # intentionally undocumented since it assumes knowledge of weave
# internals # internals
@@ -1850,19 +1844,17 @@ EOF
;; ;;
launch) launch)
deprecation_warnings "$@" deprecation_warnings "$@"
check_not_running $CONTAINER_NAME $BASE_IMAGE check_not_running router $CONTAINER_NAME $BASE_IMAGE
check_not_running $PROXY_CONTAINER_NAME $BASE_EXEC_IMAGE check_not_running proxy $PROXY_CONTAINER_NAME $BASE_EXEC_IMAGE
check_not_running plugin $PLUGIN_CONTAINER_NAME $BASE_PLUGIN_IMAGE
COMMON_ARGS=$(common_launch_args "$@") COMMON_ARGS=$(common_launch_args "$@")
launch_router "$@" launch_router "$@"
launch_proxy $COMMON_ARGS launch_proxy $COMMON_ARGS
if [ -z $WEAVE_NO_PLUGIN ] && check_docker_server_api_version 1.21 ; then [ -z $WEAVE_NO_PLUGIN ] && check_docker_server_api_version 1.21 && launch_plugin $COMMON_ARGS
check_not_running $PLUGIN_CONTAINER_NAME $BASE_PLUGIN_IMAGE
launch_plugin $COMMON_ARGS
fi
;; ;;
launch-router) launch-router)
deprecation_warnings "$@" deprecation_warnings "$@"
check_not_running $CONTAINER_NAME $BASE_IMAGE check_not_running router $CONTAINER_NAME $BASE_IMAGE
launch_router "$@" launch_router "$@"
echo $ROUTER_CONTAINER echo $ROUTER_CONTAINER
;; ;;
@@ -1876,12 +1868,12 @@ EOF
;; ;;
launch-proxy) launch-proxy)
deprecation_warnings "$@" deprecation_warnings "$@"
check_not_running $PROXY_CONTAINER_NAME $BASE_EXEC_IMAGE check_not_running proxy $PROXY_CONTAINER_NAME $BASE_EXEC_IMAGE
launch_proxy "$@" launch_proxy "$@"
echo $PROXY_CONTAINER echo $PROXY_CONTAINER
;; ;;
launch-plugin) launch-plugin)
check_not_running $PLUGIN_CONTAINER_NAME $BASE_PLUGIN_IMAGE check_not_running plugin $PLUGIN_CONTAINER_NAME $BASE_PLUGIN_IMAGE
launch_plugin "$@" launch_plugin "$@"
echo $PLUGIN_CONTAINER echo $PLUGIN_CONTAINER
;; ;;