Added documentation website content, and a workflow to publish it to GitHub Pages
* Copied, rearranged and modified the contents of the old site directory for Jekyll static site generator, into the website directory * Added some Jekyll-specific things for looks, including: * _config.yaml, Gemfile.* and 404.html files * _data, _layouts and assets directories and their content * Added .github/workflows/github-pages-publish.yml workflow
This commit is contained in:
1 parent
92779f3e57
commit
e2db8a25bd
82 files changed
+6162
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: Installing Weave Net
|
||||
menu_order: 30
|
||||
search_type: Documentation
|
||||
---
|
||||
|
||||
Install Weave Net from the command line on its own or if you are using Docker, Kubernetes or Mesosphere as a Docker or a CNI plugin.
|
||||
|
||||
|
||||
## Installing Weave Net
|
||||
|
||||
* [Installing Weave Net]({{ '/install/installing-weave' | relative_url }})
|
||||
* [Launching Weave Net]({{ '/install/using-weave' | relative_url }})
|
||||
* [Using Weave with Systemd]({{ '/install/systemd' | relative_url }})
|
||||
|
||||
## Weave Net Docker Plugin
|
||||
|
||||
* [How the Weave Net Docker Network Plugins Work]({{ '/install/plugin/plugin-how-it-works' | relative_url }})
|
||||
* [Integrating Docker via the Network Plugin (V2)]({{ '/install/plugin/plugin-v2' | relative_url }})
|
||||
* [Installation]({{ '/install/plugin/plugin-v2#installation' | relative_url }})
|
||||
* [Configuring the Plugin]({{ '/install/plugin/plugin-v2#configuring' | relative_url }})
|
||||
* [Running Services or Containers Using the Plugin]({{ '/install/plugin/plugin-v2#usage' | relative_url }})
|
||||
* [Integrating Docker via the Network Plugin (Legacy)]({{ '/install/plugin/plugin' | relative_url }})
|
||||
* [Launching Weave Net and Running Containers Using the Plugin]({{ '/install/plugin/plugin#launching' | relative_url }})
|
||||
* [Restarting the Plugin]({{ '/install/plugin/plugin#restarting' | relative_url }})
|
||||
|
||||
## Weave Net CNI plugin for Kubernetes and Mesosphere
|
||||
|
||||
* [Integrating Kubernetes and Mesos via the CNI Plugin]({{ '/kubernetes' | relative_url }})
|
||||
* [Integrating Kubernetes via the Addon]({{ '/kubernetes/kube-addon' | relative_url }})
|
||||
* [Installation]({{ '/kubernetes/kube-addon#install' | relative_url }})
|
||||
* [Upgrading the Daemon Sets]({{ '/kubernetes/kube-addon#daemon-sets' | relative_url }})
|
||||
* [CPU and Memory Requirements]({{ '/kubernetes/kube-addon#resources' | relative_url }})
|
||||
* [Pod Eviction]({{ '/kubernetes/kube-addon#eviction' | relative_url }})
|
||||
* [Network Policy Controller]({{ '/kubernetes/kube-addon#npc' | relative_url }})
|
||||
* [Troubleshooting Blocked Connections]({{ '/kubernetes/kube-addon#blocked-connections' | relative_url }})
|
||||
* [Changing Configuration Options]({{ '/kubernetes/kube-addon#configuration-options' | relative_url }})
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
---
|
||||
title: Installing Weave Net
|
||||
menu_order: 10
|
||||
search_type: Documentation
|
||||
---
|
||||
|
||||
|
||||
Ensure you are running Linux (kernel 3.8 or later) and have Docker
|
||||
(version 1.12.0 or later) installed.
|
||||
|
||||
Install Weave Net by running the following:
|
||||
|
||||
sudo curl -L https://reweave.azurewebsites.net/get-weave -o /usr/local/bin/weave
|
||||
sudo chmod a+x /usr/local/bin/weave
|
||||
|
||||
~~If you are on OSX and you are using Docker Machine ensure that a VM is running and configured
|
||||
before downloading Weave Net. To set up a VM see [the Docker Machine
|
||||
documentation](https://docs.docker.com/installation/mac/#from-your-shell) or refer to ["Part 1: Launching Weave Net with Docker Machine"](https://web.archive.org/web/20231002233731/https://www.weave.works/guides/part-1-launching-weave-net-with-docker-machine/).~~
|
||||
|
||||
After your VM is setup with Docker Machine, Weave Net can be launched directly from the OSX host. Weave Net respects the environment variable `DOCKER_HOST`, so that you can run and control a Weave Network locally on a remote host. See [Using The Weave Docker API Proxy]({{ '/tasks/weave-docker-api/using-proxy' | relative_url }}).
|
||||
|
||||
With Weave Net downloaded onto your VMs or hosts, you are ready to launch a Weave network and deploy apps onto it. See [Launching Weave Net]({{ '/install/using-weave' | relative_url }}).
|
||||
|
||||
### Quick Start Screencast
|
||||
|
||||
<a href="https://youtu.be/kihQCCT1ykE" target="_blank">
|
||||
<img src="hello-screencast.png" alt="Click to watch the screencast" />
|
||||
</a>
|
||||
|
||||
### Checkpoint
|
||||
|
||||
Weave Net [periodically contacts Weaveworks servers for available
|
||||
versions](https://github.com/weaveworks/go-checkpoint). New versions
|
||||
are announced in the log and in [the status
|
||||
summary]({{ '/troubleshooting#weave-status' | relative_url }}).
|
||||
|
||||
The information sent in this check is:
|
||||
|
||||
* Host UUID hash
|
||||
* Kernel version
|
||||
* Docker version
|
||||
* Weave Net version
|
||||
* Network mode, e.g. 'awsvpc'
|
||||
|
||||
To disable this check, run the following before launching Weave Net:
|
||||
|
||||
export CHECKPOINT_DISABLE=1
|
||||
|
||||
**Note:** Weaveworks does not maintain these servers any more. Weave Net will make the call and silently fail. This will not affect normal operations. Still, it is recommended to set the `CHECKPOINT_DISABLE` variable as shown above. This feature will be removed from the community-supported Weave Net in the near future.
|
||||
|
||||
### Guides for Specific Platforms
|
||||
|
||||
~~Amazon ECS users see [here](https://www.weave.works/docs/scope/latest/ami/)
|
||||
for the latest Weave AMIs.~~
|
||||
|
||||
If you're on Amazon EC2, the standard installation instructions at the
|
||||
top of this page, provide the simplest setup and the most flexibility.
|
||||
A [special no-overlay mode for EC2]({{ '/tasks/manage/awsvpc' | relative_url }}) can
|
||||
optionally be enabled, which allows containers to communicate at the
|
||||
full speed of the underlying network.
|
||||
|
||||
To make encryption in fast datapath work on Google Cloud Platform, see
|
||||
[here]({{ '/faq#ports' | relative_url }}).
|
||||
|
||||
**See Also**
|
||||
|
||||
* [Launching Weave Net]({{ '/install/using-weave' | relative_url }})
|
||||
* ~~[Tutorials](https://www.weave.works/docs/tutorials/)~~
|
||||
* [Features]({{ '/overview/features' | relative_url }})
|
||||
* [Troubleshooting]({{ '/troubleshooting' | relative_url }})
|
||||
* [Building]({{ '/building' | relative_url }})
|
||||
* [Using Weave with Systemd]({{ '/install/systemd' | relative_url }})
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
title: Weave Net Docker Plugin
|
||||
menu_order: 50
|
||||
search_type: Documentation
|
||||
---
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
---
|
||||
title: How the Weave Net Docker Network Plugins Work
|
||||
menu_order: 10
|
||||
search_type: Documentation
|
||||
---
|
||||
|
||||
|
||||
The Weave Net legacy plugin actually provides *two* network drivers to Docker -
|
||||
one named `weavemesh` that can operate without a cluster store and another one
|
||||
named `weave` that can only work with one (like Docker's overlay driver), while
|
||||
the V2 plugin provides *one* - `weaveworks/net-plugin:latest_release`
|
||||
operating only in swarm mode.
|
||||
|
||||
### weavemesh driver
|
||||
|
||||
* Weave Net handles all co-ordination between hosts (referred to by Docker as a "local scope" driver)
|
||||
* Supports a single network only. A network named `weave` is automatically created for you.
|
||||
* Uses Weave Net'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
|
||||
|
||||
* This runs in what Docker calls "global scope", which requires an external cluster store
|
||||
* Supports multiple networks that must be created using `docker network create --driver weave ...`
|
||||
* Used with Docker's cluster-store-based IPAM
|
||||
|
||||
There's no specific documentation from Docker on using a cluster
|
||||
store, but the first part of
|
||||
[Getting Started with Docker Multi-host Networking](https://docs.docker.com/engine/userguide/networking/get-started-overlay/) is a good place to start.
|
||||
|
||||
>**Note:** In the case of multiple networks using the `weave` driver, all containers are on the same virtual network but Docker allocates their addresses on different subnets so they cannot talk to each other directly.
|
||||
|
||||
The plugin accepts the following options via `docker network create ... --opt`:
|
||||
|
||||
* `works.weave.multicast` -- tells weave to add a static IP
|
||||
route for multicast traffic onto its interface.
|
||||
|
||||
>**Note:** If you connect a container to multiple Weave networks, at
|
||||
most one of them can have the multicast route enabled. The `weave`
|
||||
network created when the plugin is first launched has the multicast
|
||||
option turned on, but for any networks you create it defaults to off.
|
||||
|
||||
### weaveworks/net-plugin:latest_release driver
|
||||
|
||||
* The driver runs within the plugin V2.
|
||||
* Requires Docker to run in [swarm mode](https://docs.docker.com/engine/swarm/swarm-mode/).
|
||||
* Supports multiple networks.
|
||||
* Used with Docker's IPAM.
|
||||
|
||||
|
||||
**See Also**
|
||||
|
||||
* [Integrating Docker via the Network Plugin (Legacy)]({{ '/install/plugin/plugin' | relative_url }})
|
||||
* [Integrating Docker via the Network Plugin (V2)]({{ '/install/plugin/plugin-v2' | relative_url }})
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
---
|
||||
title: Integrating Docker via the Network Plugin (V2)
|
||||
menu_order: 20
|
||||
search_type: Documentation
|
||||
---
|
||||
|
||||
* [Installation](#installation)
|
||||
* [Configuring the Plugin](#configuring)
|
||||
* [Running Services or Containers Using the Plugin](#usage)
|
||||
|
||||
Docker Engine version 1.12 introduced [a new plugin system (V2)](https://docs.docker.com/engine/extend/).
|
||||
This document describes how to use the Network Plugin V2 of Weave Net.
|
||||
|
||||
Before using the plugin, please keep in mind the plugin works only in Swarm
|
||||
mode and requires Docker version 1.13 or later.
|
||||
|
||||
### <a name="installation"></a>Installation
|
||||
|
||||
To install the plugin run the following command on _each_ host already
|
||||
participating in a Swarm cluster, i.e. on all master and worker nodes:
|
||||
|
||||
$ docker plugin install weaveworks/net-plugin:latest_release
|
||||
|
||||
Docker will pull the plugin from Docker Store, and it will ask to grant
|
||||
privileges before installing the plugin. Afterwards, it will start `weaver`
|
||||
process which will try to connect to Swarm masters running Weave Net.
|
||||
|
||||
### <a name="configuring"></a>Configuring the Plugin
|
||||
|
||||
There are several configuration parameters which can be set with:
|
||||
|
||||
$ docker plugin set weaveworks/net-plugin:latest_release PARAM=VALUE
|
||||
|
||||
The parameters include:
|
||||
|
||||
* `WEAVE_PASSWORD` - if non empty, it will instruct Weave Net to encrypt
|
||||
traffic - see [here]({{ '/tasks/manage/security-untrusted-networks' | relative_url }}) for
|
||||
more details.
|
||||
* `WEAVE_MULTICAST` - set to 1 on each host running the plugin to enable
|
||||
multicast traffic on any Weave Net network.
|
||||
* `WEAVE_MTU` - Weave Net defaults to 1376 bytes, but you can set a
|
||||
smaller size if your underlying network has a tighter limit, or set
|
||||
a larger size for better performance if your network supports jumbo
|
||||
frames - see [here]({{ '/tasks/manage/fastdp#mtu' | relative_url }}) for more
|
||||
details.
|
||||
* `IPALLOC_RANGE` - the range of IP addresses used by Weave Net and the subnet
|
||||
they are placed in (CIDR format; default 10.32.0.0/12).
|
||||
See [here]({{ '/tasks/ipam/configuring-weave' | relative_url }}) for more details.
|
||||
|
||||
Before setting any parameter, the plugin has to be disabled with:
|
||||
|
||||
$ docker plugin disable weaveworks/net-plugin:latest_release
|
||||
|
||||
To re-enable the plugin run the following command:
|
||||
|
||||
$ docker plugin enable weaveworks/net-plugin:latest_release
|
||||
|
||||
### <a name="usage"></a>Running Services or Containers Using the Plugin
|
||||
|
||||
After you have launched the plugin, you can create a network for Docker Swarm
|
||||
services by running the following command on any Docker Swarm master node:
|
||||
|
||||
$ docker network create --driver=weaveworks/net-plugin:latest_release mynetwork
|
||||
|
||||
Or you can create a network for any Docker container with:
|
||||
|
||||
$ docker network create --driver=weaveworks/net-plugin:latest_release --attachable mynetwork
|
||||
|
||||
To start a service attached to the network run, for example:
|
||||
|
||||
$ docker service create --network=mynetwork ...
|
||||
|
||||
Or to start a container:
|
||||
|
||||
$ docker run --network=mynetwork ...
|
||||
|
||||
**See Also**
|
||||
|
||||
* [Integrating Docker via the Network Plugin (Legacy)]({{ '/install/plugin/plugin' | relative_url }})
|
||||
* [How the Weave Network Plugins Work]({{ '/install/plugin/plugin-how-it-works' | relative_url }})
|
||||
* [Troubleshooting the V2 plugin]({{ '/troubleshooting#v2plugin' | relative_url }})
|
||||
@@ -0,0 +1,99 @@
|
||||
---
|
||||
title: Integrating Docker via the Network Plugin (Legacy)
|
||||
menu_order: 30
|
||||
search_type: Documentation
|
||||
---
|
||||
|
||||
* [Launching Weave Net and Running Containers Using the Plugin](#launching)
|
||||
* [Restarting the Plugin](#restarting)
|
||||
|
||||
Docker versions 1.9 and later have a plugin mechanism for adding
|
||||
different network providers. Weave Net installs itself as a network
|
||||
plugin when you start it with `weave launch`. The Weave Docker
|
||||
Networking Plugin is fast and easy to use, and, unlike other
|
||||
networking plugins, does not require an external cluster store.
|
||||
|
||||
To create a network which can span multiple Docker hosts, Weave Net peers must be connected to each other, by specifying the other hosts during `weave launch` or via
|
||||
[`weave connect`]({{ '/tasks/manage/finding-adding-hosts-dynamically' | relative_url }}).
|
||||
|
||||
See [Launching Weave Net]({{ '/install/using-weave#peer-connections' | relative_url }}) for a discussion on peer connections.
|
||||
|
||||
After you've launched Weave Net and peered your hosts, you can start containers using the following, for example:
|
||||
|
||||
$ docker run --net=weave -ti weaveworks/ubuntu
|
||||
|
||||
on any of the hosts, and they can all communicate with each other
|
||||
using any protocol, even multicast.
|
||||
|
||||
In order to use Weave Net's [Service Discovery]({{ '/tasks/weavedns/weavedns' | relative_url }}) you
|
||||
must pass the additional arguments `--dns` and `-dns-search`, for
|
||||
which a helper is provided in the Weave script:
|
||||
|
||||
$ docker run --net=weave -h foo.weave.local $(weave dns-args) -tdi weaveworks/ubuntu
|
||||
$ docker run --net=weave -h bar.weave.local $(weave dns-args) -ti weaveworks/ubuntu
|
||||
# ping foo
|
||||
|
||||
|
||||
### <a name="launching"></a>Launching Weave Net and Running Containers Using the Plugin
|
||||
|
||||
Just launch the Weave Net router onto each host and make a peer connection with the other hosts:
|
||||
|
||||
host1$ weave launch host2
|
||||
host2$ weave launch host1
|
||||
|
||||
then run your containers using the Docker command-line:
|
||||
|
||||
host1$ docker run --net=weave -ti weaveworks/ubuntu
|
||||
root@1458e848cd90:/# hostname -i
|
||||
10.32.0.2
|
||||
|
||||
host2$ docker run --net=weave -ti weaveworks/ubuntu
|
||||
root@8cc4b5dc5722:/# ping 10.32.0.2
|
||||
|
||||
PING 10.32.0.2 (10.32.0.2) 56(84) bytes of data.
|
||||
64 bytes from 10.32.0.2: icmp_seq=1 ttl=64 time=0.116 ms
|
||||
64 bytes from 10.32.0.2: icmp_seq=2 ttl=64 time=0.052 ms
|
||||
|
||||
|
||||
### <a name="multi"></a>Creating multiple Docker Networks
|
||||
|
||||
Docker enables you to create multiple independent networks and attach
|
||||
different sets of containers to each network. However, coordinating
|
||||
this between hosts requires that you run Docker in ["swarm mode"](https://docs.docker.com/engine/swarm/swarm-mode/) or configure a
|
||||
["key-value store"](https://docs.docker.com/engine/userguide/networking/get-started-overlay/#/set-up-a-key-value-store).
|
||||
|
||||
To operate in swarm mode, you are required to use the plugin v2 of Weave Net.
|
||||
See [Integrating Docker via the Network Plugin (V2)]({{ '/install/plugin/plugin-v2' | relative_url }}) for
|
||||
more details.
|
||||
|
||||
If your Docker installation has a key-value store, create a network
|
||||
based on Weave Net as follows:
|
||||
|
||||
$ docker network create --driver=weave mynetwork
|
||||
|
||||
then use it to connect a container:
|
||||
|
||||
$ docker run --net=mynetwork ...
|
||||
|
||||
or
|
||||
|
||||
$ docker network connect mynetwork somecontainer
|
||||
|
||||
Containers attached to different Docker Networks are
|
||||
[isolated through subnets]({{ '/tasks/manage/application-isolation' | relative_url }}).
|
||||
|
||||
|
||||
### <a name="restarting"></a>Restarting the Plugin
|
||||
|
||||
The plugin, like all Weave Net components, is started with a policy of `--restart=always`, so that it is always there after a restart or reboot. If you remove this container (for example, when using `weave reset`) before removing all endpoints created using `--net=weave`, Docker may hang for a long time when it subsequently tries to re-establish communications to the plugin.
|
||||
|
||||
Unfortunately, [Docker 1.9 may also try to communicate with the plugin before it has even started it](https://github.com/docker/libnetwork/issues/813).
|
||||
|
||||
If you are using `systemd` with Docker 1.9, it is advised that you modify the Docker unit to remove the timeout on startup. This gives Docker enough time to abandon its attempts. For example, in the file `/lib/systemd/system/docker.service`, add the following under `[Service]`:
|
||||
|
||||
TimeoutStartSec=0
|
||||
|
||||
|
||||
**See Also**
|
||||
|
||||
* [How the Weave Network Plugins Work]({{ '/install/plugin/plugin-how-it-works' | relative_url }})
|
||||
@@ -0,0 +1,70 @@
|
||||
---
|
||||
title: Using Weave with Systemd
|
||||
menu_order: 40
|
||||
search_type: Documentation
|
||||
---
|
||||
|
||||
|
||||
Having installed Weave Net as per [Installing Weave]({{ '/install/installing-weave' | relative_url }}), you might find it convenient to configure the
|
||||
init daemon to start Weave on boot. Most recent Linux distribution releases ship with [systemd](http://www.freedesktop.org/wiki/Software/systemd/). The information below provides you with some initial guidance on getting a Weave Net service configured on a systemd-based OS.
|
||||
|
||||
## Weave Net Service Unit and Configuration
|
||||
|
||||
A regular service unit definition for Weave Net is shown below. This file is
|
||||
normally placed in `/etc/systemd/system/weave.service`.
|
||||
|
||||
[Unit]
|
||||
Description=Weave Network
|
||||
Documentation=http://docs.weave.works/weave/latest_release/
|
||||
Requires=docker.service
|
||||
After=docker.service
|
||||
[Service]
|
||||
EnvironmentFile=-/etc/sysconfig/weave
|
||||
ExecStartPre=/usr/local/bin/weave launch --no-restart $PEERS
|
||||
ExecStart=/usr/bin/docker attach weave
|
||||
ExecStop=/usr/local/bin/weave stop
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
|
||||
To specify the addresses or names of other Weave hosts to join the network,
|
||||
create the `/etc/sysconfig/weave` environment file using the following format:
|
||||
|
||||
PEERS="HOST1 HOST2 .. HOSTn"
|
||||
|
||||
You can also use the [`weave connect`]({{ '/tasks/manage/finding-adding-hosts-dynamically' | relative_url }}) command to add participating hosts dynamically.
|
||||
|
||||
Additionally, if you want to enable [encryption]({{ '/tasks/manage/security-untrusted-networks' | relative_url }}) specify a
|
||||
password using `WEAVE_PASSWORD="wfvAwt7sj"` in the `/etc/sysconfig/weave` environment file, and it will get picked up by
|
||||
Weave Net on launch. Recommendations for choosing a suitably strong password can be found [here]({{ '/tasks/manage/security-untrusted-networks' | relative_url }}).
|
||||
|
||||
You can now launch Weave Net using
|
||||
|
||||
sudo systemctl start weave
|
||||
|
||||
To ensure Weave Net launches after reboot, run:
|
||||
|
||||
sudo systemctl enable weave
|
||||
|
||||
For more information on systemd, please refer to the documentation supplied
|
||||
with your distribution of Linux.
|
||||
|
||||
## SELinux Tweaks
|
||||
|
||||
If your OS has SELinux enabled and you want to run Weave Net as a systemd unit,
|
||||
then follow the instructions below. These instructions apply to
|
||||
CentOS and RHEL as of 7.0. On Fedora 21, there is no need to do this.
|
||||
|
||||
Once `weave` is installed in `/usr/local/bin`, set its execution
|
||||
context with the commands shown below. You will need to have the
|
||||
`policycoreutils-python` package installed.
|
||||
|
||||
sudo semanage fcontext -a -t unconfined_exec_t -f f /usr/local/bin/weave
|
||||
sudo restorecon /usr/local/bin/weave
|
||||
|
||||
**See Also**
|
||||
|
||||
* [Launching Weave Net]({{ '/install/using-weave' | relative_url }})
|
||||
* [Tutorials](https://www.weave.works/docs/tutorials/)
|
||||
* [Features]({{ '/overview/features' | relative_url }})
|
||||
* [Troubleshooting]({{ '/troubleshooting' | relative_url }})
|
||||
@@ -0,0 +1,140 @@
|
||||
---
|
||||
title: Launching Weave Net
|
||||
menu_order: 20
|
||||
search_type: Documentation
|
||||
---
|
||||
|
||||
Weave Net provides a simple to deploy networking solution for containerized apps. Here, we describe how to manage a Weave container network using a sample application which consists of two simple `netcat` services deployed to containers on two separate hosts.
|
||||
|
||||
This section contains the following topics:
|
||||
|
||||
* [Launching Weave Net](#launching)
|
||||
* [Creating Peer Connections Between Hosts](#peer-connections)
|
||||
* [Testing Container Communications](#testing)
|
||||
* [Starting the Netcat Service](#start-netcat)
|
||||
|
||||
### <a name="launching"></a>Launching Weave Net
|
||||
|
||||
Before launching Weave Net and deploying your apps, ensure that Docker is [installed](https://docs.docker.com/engine/installation/) on both hosts.
|
||||
|
||||
On `$HOST1` run:
|
||||
|
||||
host1$ weave launch
|
||||
host1$ eval $(weave env)
|
||||
host1$ docker run --name a1 -ti weaveworks/ubuntu
|
||||
|
||||
Where,
|
||||
|
||||
* The first line runs Weave Net.
|
||||
* The second line configures the Weave Net environment, so that containers launched via the Docker command line are automatically attached to the Weave network, and,
|
||||
* The third line runs the [application container]({{ '/faq#own-image' | relative_url }}) using [a Docker command](https://docs.docker.com/reference/cli/docker/container/run/).
|
||||
|
||||
> **Note** If the first command results in an error like
|
||||
> ```
|
||||
> Cannot connect to the Docker daemon. Is the docker daemon running on this host?
|
||||
> ```
|
||||
> or
|
||||
> ```
|
||||
> http:///var/run/docker.sock/v1.19/containers/create: dial unix/var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?
|
||||
> ```
|
||||
> then you likely need to be 'root' in order to connect to the Docker
|
||||
> daemon. If so, run the above and all subsequent commands in a
|
||||
> *single* root shell:
|
||||
> ```
|
||||
> host1$ sudo -s
|
||||
> host1# weave launch
|
||||
> host1# eval $(weave env)
|
||||
> host1# docker run --name a1 -ti weaveworks/ubuntu
|
||||
> ```
|
||||
> Do *not* prefix individual commands with `sudo`, since some commands
|
||||
> modify environment entries and hence they all need to be executed from
|
||||
> the same shell.
|
||||
|
||||
Weave Net must be launched once per host. The relevant container images will be pulled down from Docker Hub on demand during `weave launch`.
|
||||
|
||||
You can also preload the images by running `weave setup`. Preloaded images are useful for automated deployments, and ensure there are no delays during later operations.
|
||||
|
||||
If you are deploying an application that consists of more than one container to the same host, launch them one after another using `docker run`, as appropriate.
|
||||
|
||||
|
||||
### <a name="peer-connections"></a>Creating Peer Connections Between Hosts
|
||||
|
||||
To launch Weave Net on an additional host and create a peer connection, run the following:
|
||||
|
||||
host2$ weave launch $HOST1
|
||||
host2$ eval $(weave env)
|
||||
host2$ docker run --name a2 -ti weaveworks/ubuntu
|
||||
|
||||
As noted above, the same steps are repeated for `$HOST2`. The only difference, besides the application container’s name, is that `$HOST2` is told to peer with Weave Net on `$HOST1` during launch.
|
||||
|
||||
You can also peer with other hosts by specifying the IP address, and a `:port` by which `$HOST2` can reach `$HOST1`.
|
||||
|
||||
>**Note:** If there is a firewall between `$HOST1` and `$HOST2`, you must permit traffic to flow through TCP 6783 and UDP 6783/6784, which are Weave’s control and data ports.
|
||||
|
||||
There are a number of different ways that you can specify peers on a Weave network. You can launch Weave Net on `$HOST1` and then peer with `$HOST2`, or you can launch on `$HOST2` and peer with `$HOST1` or you can tell both hosts about each other at launch. The order in which peers are specified is not important. Weave Net automatically (re)connects to peers when they become available.
|
||||
|
||||
#### Specifying Multiple Peers at Launch
|
||||
|
||||
To specify multiple peers, supply a list of addresses to which you want to connect, all separated by spaces.
|
||||
|
||||
For example:
|
||||
|
||||
host2$ weave launch <ip address> <ip address>
|
||||
|
||||
Peers can also be dynamically added. See [Adding Hosts Dynamically]({{ '/tasks/manage/finding-adding-hosts-dynamically' | relative_url }}) for more information.
|
||||
|
||||
#### Restricting Access
|
||||
|
||||
By default Weave Net listens on all host IPs (i.e. 0.0.0.0). This
|
||||
can be altered with the `--host` parameter to `weave launch`, for example,
|
||||
to ensure that Weave Net only listens on IPs on an internal network.
|
||||
|
||||
Standard firewall rules can be deployed to restrict access to the
|
||||
Weave Net control and data ports.
|
||||
|
||||
For communication across untrusted networks, connections can be
|
||||
[encrypted]({{ '/tasks/manage/security-untrusted-networks' | relative_url }}).
|
||||
|
||||
### <a name="testing"></a>Testing Container Communications
|
||||
|
||||
With two containers running on separate hosts, test that both containers are able to find and communicate with one another using ping.
|
||||
|
||||
From the container started on `$HOST1`...
|
||||
|
||||
|
||||
root@a1:/# ping -c 1 -q a2
|
||||
PING a2.weave.local (10.40.0.2) 56(84) bytes of data.
|
||||
--- a2.weave.local ping statistics ---
|
||||
1 packets transmitted, 1 received, 0% packet loss, time 0ms
|
||||
rtt min/avg/max/mdev = 0.341/0.341/0.341/0.000 ms
|
||||
|
||||
Similarly, in the container started on `$HOST2`...
|
||||
|
||||
root@a2:/# ping -c 1 -q a1
|
||||
PING a1.weave.local (10.32.0.2) 56(84) bytes of data.
|
||||
--- a1.weave.local ping statistics ---
|
||||
1 packets transmitted, 1 received, 0% packet loss, time 0ms
|
||||
rtt min/avg/max/mdev = 0.366/0.366/0.366/0.000 ms
|
||||
|
||||
### <a name="start-netcat"></a>Starting the Netcat Service
|
||||
|
||||
The `netcat` service can be started using the following commands:
|
||||
|
||||
root@a1:/# nc -lk -p 4422
|
||||
|
||||
and then connected to from the another container on `$HOST2` using:
|
||||
|
||||
root@a2:/# echo 'Hello, world.' | nc a1 4422
|
||||
|
||||
Weave Net supports *any* protocol, and it doesn't have to be over TCP/IP. For example, a netcat UDP service can also be run by using the following:
|
||||
|
||||
root@a1:/# nc -lu -p 5533
|
||||
root@a2:/# echo 'Hello, world.' | nc -u a1 5533
|
||||
|
||||
|
||||
**See Also**
|
||||
|
||||
* [Installing Weave Net]({{ '/install/installing-weave' | relative_url }})
|
||||
* [Using Fastdp With Weave Net]({{ '/tasks/manage/fastdp' | relative_url }})
|
||||
* [Integrating Docker via the Network Plugin (Legacy)]({{ '/install/plugin/plugin' | relative_url }})
|
||||
* [Integrating Docker via the Network Plugin (V2)]({{ '/install/plugin/plugin-v2' | relative_url }})
|
||||
Reference in new issue
Block a user