Skip to content

Commit

Permalink
banish ~~~bash
Browse files Browse the repository at this point in the history
Just use indenting, which is much easier on the eye.
  • Loading branch information
rade committed Mar 29, 2016
1 parent a1eb940 commit 6f68242
Show file tree
Hide file tree
Showing 30 changed files with 60 additions and 306 deletions.
18 changes: 6 additions & 12 deletions site/fastdp/using-fastdp.md
Expand Up @@ -14,9 +14,7 @@ See [How Fastdp Works](/site/fastdp/fastdp-how-it-works.md) for a more in-depth

You can disable fastdp by enabling the `WEAVE_NO_FASTDP` environment variable at `weave launch`:

~~~bash
$ WEAVE_NO_FASTDP=true weave launch
~~~
$ WEAVE_NO_FASTDP=true weave launch

###Fast Datapath and Encryption

Expand All @@ -36,20 +34,16 @@ The use of fast datapath is an automated connection-by-connection decision made

Once a Weave network is set up, you can query the connections using the `weave status connections` command:

~~~bash
$ weave status connections
<-192.168.122.25:43889 established fastdp a6:66:4f:a5:8a:11(ubuntu1204)
~~~
$ weave status connections
<-192.168.122.25:43889 established fastdp a6:66:4f:a5:8a:11(ubuntu1204)

Where fastdp indicates that fast datapath is being used on a connection. If fastdp is not shown, the field displays `sleeve` indicating Weave Net's fall-back encapsulation method:

~~~bash
$ weave status connections
<- 192.168.122.25:54782 established sleeve 8a:50:4c:23:11:ae(ubuntu1204)
~~~
$ weave status connections
<- 192.168.122.25:54782 established sleeve 8a:50:4c:23:11:ae(ubuntu1204)

**See Also**

* [Deploying Applications to Weave](/site/using-weave/deploying-applications.md)
* [How Fastdp Works](/site/fastdp/fastdp-how-it-works.md)


2 changes: 0 additions & 2 deletions site/ip-addresses/configuring-weave.md
Expand Up @@ -13,11 +13,9 @@ cause a clash.
If after `weave launch`, the following error message
appears:

~~~bash
Network 10.32.0.0/12 overlaps with existing route 10.0.0.0/8 on host.
ERROR: Default --ipalloc-range 10.32.0.0/12 overlaps with existing route on host.
You must pick another range and set it on all hosts.
~~~

As the message indicates, the default range that Weave Net would like to use is
`10.32.0.0/12` - a 12-bit prefix, where all addresses start with the bit
Expand Down
2 changes: 0 additions & 2 deletions site/ip-addresses/ip-addresses.md
Expand Up @@ -42,12 +42,10 @@ Several websites offer calculators to decode this kind of address, see: [IP Addr
The following is an example route table for a container that is attached to a Weave
network:

~~~bash
# ip route show
default via 172.17.42.1 dev eth0
10.2.2.0/24 dev ethwe proto kernel scope link src 10.2.2.1
172.17.0.0/16 dev eth0 proto kernel scope link src 172.17.0.170
~~~

It has two interfaces: one that Docker gave it called `eth0`, and one
that weave gave it called `ethwe`. They are on networks
Expand Down
14 changes: 3 additions & 11 deletions site/ipam/overview-init-ipam.md
Expand Up @@ -67,20 +67,16 @@ To illustrate, suppose you have three hosts, accessible to each other
as `$HOST1`, `$HOST2` and `$HOST3`. You can start Weave Net on those three
hosts using these three commands:

~~~bash
host1$ weave launch $HOST2 $HOST3
host2$ weave launch $HOST1 $HOST3
host3$ weave launch $HOST1 $HOST2
~~~
host1$ weave launch $HOST2 $HOST3
host2$ weave launch $HOST1 $HOST3
host3$ weave launch $HOST1 $HOST2

Or, if it is not convenient to name all the other hosts at launch
time, you can pass the number of peers like this:

~~~bash
host1$ weave launch --init-peer-count 3
host2$ weave launch --init-peer-count 3 $HOST3
host3$ weave launch --init-peer-count 3 $HOST2
~~~

The consensus mechanism used to determine a majority, transitions
through three states: 'deferred', 'waiting' and 'achieved':
Expand All @@ -97,9 +93,7 @@ Finally, some (but never all) peers can be launched as consensus
observers rather than participants by specifying the `--observer`
option:

~~~bash
host4$ weave launch --observer $HOST3
~~~

You do not need to specify an initial peer count to such peers. This
can be useful to add ephemeral peers to an existing fixed cluster (for
Expand Down Expand Up @@ -137,7 +131,6 @@ independent set again.
To illustrate this last point, the following sequence of operations
is safe with respect to Weave Net's startup quorum:

~~~bash
host1$ weave launch
...time passes...
host2$ weave launch $HOST1
Expand All @@ -146,7 +139,6 @@ is safe with respect to Weave Net's startup quorum:
...time passes...
...host1 is rebooted...
host1$ weave launch $HOST2 $HOST3
~~~

### <a name="forcing-consensus"></a>Forcing Consensus

Expand Down
2 changes: 0 additions & 2 deletions site/ipam/stop-remove-peers-ipam.md
Expand Up @@ -26,10 +26,8 @@ Assume you had started the three peers in the
[overview example](/site/ipam/overview-init-ipam.md), and then host3
caught fire, you can go to one of the other hosts and run:

~~~bash
host1$ weave rmpeer host3
524288 IPs taken over from host3
~~~

Weave Net takes all the IP address ranges owned by host3 and transfers
them to be owned by host1. The name "host3" is resolved via the
Expand Down
6 changes: 2 additions & 4 deletions site/ipam/troubleshooting-ipam.md
Expand Up @@ -6,20 +6,18 @@ layout: default

The command

~~~bash
weave status
~~~

reports on the current status of the weave router and IP allocator:

~~~bash
````
...
Service: ipam
Status: awaiting consensus (quorum: 2, known: 0)
Range: 10.32.0.0-10.47.255.255
DefaultSubnet: 10.32.0.0/12
...
~~~
````

The first section covers the router; see the [troubleshooting
guide](/site/troubleshooting.md#weave-status) for full details.
Expand Down
10 changes: 0 additions & 10 deletions site/plugin/cni-plugin-how-to.md
Expand Up @@ -16,16 +16,12 @@ your machine has the directories normally used to host CNI plugins.

To create those directories, run (as root):

~~~bash
mkdir -p /opt/cni/bin
mkdir -p /etc/cni/net.d
~~~

Then run:

~~~bash
weave setup
~~~

###Launching Weave Net

Expand All @@ -37,20 +33,16 @@ See [Deploying Applications to Weave Net](/site/using-weave/deploying-applicatio
As well as launching Weave Net, you have to run an extra command to
perform some additional configuration of the Weave bridge:

~~~bash
weave launch <peer hosts>
weave expose
~~~

###Configuring Kubernetes to use the CNI Plugin

After you've launched Weave and peered your hosts, you can configure
Kubernetes to use Weave, by adding the following options to the
`kubelet` command:

~~~bash
--network-plugin=cni --network-plugin-dir=/etc/cni/net.d
~~~

See the [`kubelet` documentation](http://kubernetes.io/v1.1/docs/admin/kubelet.html)
for more details.
Expand All @@ -68,11 +60,9 @@ for details on the format and contents of this file.

By default, the Weave CNI plugin adds a default route out via the Weave bridge, so your containers can access resources on the internet. If you do not want this, add a section to the config file that specifies no routes:

~~~bash
"ipam": {
"routes": [ ]
}
~~~

The following other fields in the spec are supported:

Expand Down
4 changes: 1 addition & 3 deletions site/plugin/plug-in-command-line.md
Expand Up @@ -8,10 +8,8 @@ layout: default
If you need to give additional arguments to the plugin independently, don't
use `weave launch`, but instead run:

~~~bash
$ weave launch-router [other peers]
$ weave launch-plugin [plugin arguments]
~~~

The plugin command-line arguments are:

Expand All @@ -32,4 +30,4 @@ route, add the `--no-multicast-route` flag to `weave launch-plugin`.
**See Also**

* [Using the Weave Net Docker Network Plugin](/site/plugin/weave-plugin-how-to.md)
* [How the Weave Network Plugin Works](/site/plugin/plugin-how-it-works.md)
* [How the Weave Network Plugin Works](/site/plugin/plugin-how-it-works.md)
32 changes: 10 additions & 22 deletions site/plugin/weave-plugin-how-to.md
Expand Up @@ -16,9 +16,7 @@ See [Deploying Applications to Weave Net](/site/using-weave/deploying-applicatio

After you've launched Weave Net and peered your hosts, you can start containers using the following, for example:

~~~bash
$ docker run --net=weave -ti ubuntu
~~~

on any of the hosts, and they can all communicate with each other.

Expand All @@ -28,38 +26,30 @@ In order to use Weave Net's [Service Discovery](/site/weavedns/overview-using-we
must pass the additional arguments `--dns` and `-dns-search`, for
which a helper is provided in the Weave script:

~~~bash
$ docker run --net=weave -h foo.weave.local $(weave dns-args) -tdi ubuntu
$ docker run --net=weave -h bar.weave.local $(weave dns-args) -ti ubuntu
# ping foo
~~~


###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:

~~~bash
host1$ weave launch host2
host2$ weave launch host1
~~~
host1$ weave launch host2
host2$ weave launch host1

then run your containers using the Docker command-line:

~~~bash
host1$ docker run --net=weave -ti ubuntu
root@1458e848cd90:/# hostname -i
10.32.0.2
~~~
host1$ docker run --net=weave -ti ubuntu
root@1458e848cd90:/# hostname -i
10.32.0.2

~~~bash
host2$ docker run --net=weave -ti ubuntu
root@8cc4b5dc5722:/# ping 10.32.0.2
host2$ docker run --net=weave -ti 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
~~~
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


### Restarting the Plugin
Expand All @@ -70,9 +60,7 @@ Unfortunately, [Docker 1.9 may also try to communicate with the plugin before it

If you are using `systemd`, 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]`:

~~~bash
TimeoutStartSec=0
~~~

###Bypassing the Central Cluster Store When Building Docker Apps

Expand Down

0 comments on commit 6f68242

Please sign in to comment.