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:
Raj Chaudhuri committed 2024-03-18 20:37:53 +05:30
1 parent 92779f3e57
commit e2db8a25bd
82 files changed
+6162

No files matched your search

@@ -0,0 +1,68 @@
---
title: Automatic Allocation Across Multiple Subnets
menu_order: 30
search_type: Documentation
---
IP subnets are used to define or restrict routing. By default, Weave Net
puts all containers into a subnet that spans the entire allocation
range, so that every Weave-attached container can communicate with every other
Weave-attached container.
If you want some [isolation]({{ '/tasks/manage/application-isolation' | relative_url }}), you
can choose to run containers on different subnets. To request the
allocation of an address from a particular subnet, set the
`WEAVE_CIDR` environment variable to `net:<subnet>` when creating the
container, for example:
host1$ docker run -e WEAVE_CIDR=net:10.2.7.0/24 -ti weaveworks/ubuntu
You can ask for multiple addresses in different subnets and add in
manually-assigned addresses (outside the automatic allocation range),
for instance:
host1$ docker run -e WEAVE_CIDR="net:10.2.7.0/24 net:10.2.8.0/24 ip:10.3.9.1/24" -ti weaveworks/ubuntu
>**Note:** The ".0" and ".-1" addresses in a subnet are not used, as required by
[RFC 1122](https://tools.ietf.org/html/rfc1122#page-29)).
When working with multiple subnets in this way, it is usually
desirable to constrain the default subnet - for example, the one chosen by the
allocator when no subnet is supplied - so that it does not overlap
with others. You can specify this by using `--ipalloc-default-subnet`:
host1$ weave launch --ipalloc-range 10.2.0.0/16 --ipalloc-default-subnet 10.2.3.0/24
`--ipalloc-range` should cover the entire range that you will ever use
for allocation, and `--ipalloc-default-subnet` is the subnet that will
be used when you don't explicitly specify one.
When specifying addresses, the default subnet can be denoted
symbolically using `net:default`.
### <a name="manual"></a>Mixing automatic and manual allocation
Containers can be started using a mixture of automatically-allocated
addresses and manually-chosen addresses in the same range. However, you may
find that the automatic allocator has already reserved a specific
address that you wanted.
To reserve a range for manual allocation in the same subnet as the
automatic allocator, you can specify an
`--ipalloc-range` that is smaller than `--ip-default-subnet`, For
example, if you launch weave with:
host1$ weave launch --ipalloc-range 10.9.0.0/17 --ipalloc-default-subnet 10.9.0.0/16
then you can run all containers in the 10.9.0.0/16 subnet, with
automatic allocation using the lower half, leaving the upper half free
for manual allocation.
**See Also**
* [Address Allocation with IP Address Management (IPAM)]({{ '/tasks/ipam/ipam' | relative_url }})
* [Isolating Applications on a Weave Network]({{ '/tasks/manage/application-isolation' | relative_url }})
* [Starting, Stopping and Removing Peers]({{ '/tasks/ipam/stop-remove-peers-ipam' | relative_url }})
+43
View File
@@ -0,0 +1,43 @@
---
title: Allocating IPs in a Specific Range
menu_order: 10
search_type: Documentation
---
The default configurations for both Weave Net and Docker use [Private
Networks](https://en.wikipedia.org/wiki/Private_network), whose
addresses are never found on the public Internet, and subsequently reduces the
chance of IP overlap. However, it could be that you or your hosting provider
are using some of these private addresses in the same range, which will
cause a clash.
If after `weave launch`, the following error message
appears:
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
pattern 000010100010, or in decimal everything from 10.32.0.0 through
10.47.255.255.
However, your host is using a route for `10.0.0.0/8`,
which overlaps, since the first 8 bits are the same. In this case, if you used the default network
for an address like `10.32.5.6` the kernel would never be sure if this meant the
Weave Net network of `10.32.0.0/12` or the hosting network of
`10.0.0.0/8`.
If you are sure the addresses you want are not in use, then
explicitly setting the range with `--ipalloc-range` in the
command-line arguments to `weave launch` on all hosts forces Weave
Net to use that range, even though it overlaps. Otherwise, you can
pick a different range, preferably another subset of the [Private
Networks](https://en.wikipedia.org/wiki/Private_network). For example
172.30.0.0/16.
**See Also**
* [IP Addresses, Routes and Networks]({{ '/concepts/ip-addresses' | relative_url }})
+5
View File
@@ -0,0 +1,5 @@
---
title: Administering IP Addresses
menu_order: 20
search_type: Documentation
---
+206
View File
@@ -0,0 +1,206 @@
---
title: Allocating IP Addresses
menu_order: 5
search_type: Documentation
---
Weave Net automatically assigns containers a unique IP address
across the network, and also releases that address when the container
exits. Unless you explicitly specify an address, this occurs for all
invocations of the
`attach`, `detach`, `expose`, and `hide` commands. Weave Net can also assign
addresses in multiple subnets.
The following automatic IP address management topics are discussed:
* [Initializing Peers on a Weave Network](#initialization)
* [`--ipalloc-init:consensus` and How Quorum is Achieved](#quorum)
* [Priming a Peer](#priming-a-peer)
* [Choosing an Allocation Range](#range)
### <a name="initialization"></a>Initializing Peers on a Weave Network
Three initialization strategies are available: seed, consensus and
observer. These options have different tradeoffs, so pick the one that
suits your deployment best.
#### <a name="seed"></a>Via Seed
Configuration via seed requires you to provide a list of _peer names_
(via the `--ipalloc-init seed=` parameter) amongst which the address
space will be shared initially. Normally weave derives a unique peer
name automatically at launch, but since you need to know them ahead of
time in this case you will need to name each peer explicitly via the
`--name` parameter.
> Peers in the weave network are identified by a 48-bit value
> formatted like an ethernet MAC address (e.g. 01:23:45:67:89:ab) -
> you can either specify the name fully, or substitute a single run of
> zero-octets using the `::` notation, similar to
> [IPv6 address representation](https://en.wikipedia.org/wiki/IPv6_address#Recommended_representation_as_text):
>
> * `00:00:00:00:00:01` can be written `::1`
> * `01:00:00:00:00:00` can be written `1::`
> * `01:00:00:00:00:01` can be written `1::1`
host1$ weave launch --name ::1 --ipalloc-init seed=::1,::2,::3
host2$ weave launch --name ::2 --ipalloc-init seed=::1,::2,::3
host3$ weave launch --name ::3 --ipalloc-init seed=::1,::2,::3
In this configuration each peer knows in advance how the address space
has been divided up, and will be able to perform allocations from the
outset even under conditions of partition - no consensus is required.
#### <a name="consensus"></a>Via One-off Consensus
Alternatively, you can let Weave Net determine the seed automatically
via a consensus algorithm. Since you don't need to provide it with a
list of peer names anymore, you can let Weave Net derive those
automatically for you as well.
However, in order for Weave Net to form a single consensus
reliably you must now instead tell each peer how many peers there are
in total either by listing them as target peers or using the
`--ipalloc-init consensus=` parameter.
Just once, when the first automatic IP address allocation is requested
in the whole network, Weave Net needs a majority of peers to be present in
order to avoid formation of isolated groups, which can lead to
inconsistency, for example, the same IP address being allocated to two
different containers.
Therefore, you must either supply the list of all peers in the network at `weave launch` or add the
`--ipalloc-init consensus=` flag to specify how many peers there will be.
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:
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:
host1$ weave launch --ipalloc-init consensus=3
host2$ weave launch --ipalloc-init consensus=3 $HOST3
host3$ weave launch --ipalloc-init consensus=3 $HOST2
The consensus mechanism used to determine a majority transitions
through three states: 'deferred', 'waiting' and 'achieved':
* 'deferred' - no allocation requests or claims have been made yet;
consensus is deferred until then
* 'waiting' - an attempt to achieve consensus is ongoing, triggered by
an allocation or claim request; allocations will block. This state
persists until a quorum of peers are able to communicate amongst
themselves successfully
* 'achieved' - consensus achieved; allocations proceed normally
#### <a name="observer"></a>Via Observation
Finally, some (but never all) peers can be launched as observers
by specifying the `--ipalloc-init observer` option:
host4$ weave launch --ipalloc-init observer $HOST3
You do not need to specify an initial peer count or seed to such
peers. This can be useful to add peers to an existing fixed cluster
(for example in response to a scale-out event) without worrying about
adjusting initial peer counts accordingly.
#### <a name="quorum"></a> `--ipalloc-init consensus=` and How Quorum is Achieved
Normally it isn't a problem to over-estimate the value supplied to
`--ipalloc-init consensus=`, but if you supply a number that is too
small, then multiple independent groups may form.
Weave Net uses the estimate of the number of peers at initialization to
compute a majority or quorum number - specifically floor(n/2) + 1.
If the actual number of peers is less than half the number stated, then
they keep waiting for someone else to join in order to reach a quorum.
But if the actual number is more than twice the quorum
number, then you may end up with two sets of peers with each reaching a quorum and
initializing independent data structures. You'd have to be quite unlucky
for this to happen in practice, as they would have to go through the whole
agreement process without learning about each other, but it's
definitely possible.
The quorum number is only used once at start-up (specifically, the
first time someone tries to allocate or claim an IP address). Once
a set of peers is initialized, you can add more and they will join on
to the data structure used by the existing set.
The one issue to watch is if the earlier peers are restarted, you must restart
them using the current number of peers. If they use the smaller number
that was correct when they first started, then they could form an
independent set again.
To illustrate this last point, the following sequence of operations
is safe with respect to Weave Net's startup quorum:
host1$ weave launch
...time passes...
host2$ weave launch $HOST1
...time passes...
host3$ weave launch $HOST1 $HOST2
...time passes...
...host1 is rebooted...
host1$ weave launch $HOST2 $HOST3
### <a name="priming-a-peer"></a>Priming a Peer
Under certain circumstances (for example when adding new peers to an
existing network) it is desirable to ensure that a peer has
successfully joined and is ready to allocate IP addresses. An
administrative command is provided for this purpose:
host1$ weave prime
This operation will block until the peer on which it is run has joined
successfully.
### <a name="range"></a>Choosing an Allocation Range
By default, Weave Net allocates IP addresses in the 10.32.0.0/12
range. This can be overridden with the `--ipalloc-range` option:
host1$ weave launch --ipalloc-range 10.2.0.0/16
and must be the same on every host.
The range parameter is written in
[CIDR notation](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) -
in this example "/16" means the first 16 bits of the address form the
network address and the allocator is to allocate container addresses
that all start 10.2. See [IP
addresses and routes]({{ '/concepts/ip-addresses' | relative_url }}) for more information.
Weave shares the IP address range across all peers, dynamically
according to their needs. If a group of peers becomes isolated from
the rest (a partition), they can continue to work with the address
ranges they had before isolation, and can subsequently be re-connected
to the rest of the network without any conflicts arising.
### <a name="persistence"></a>Data persistence
Key IPAM data is saved to disk, so that it is immediately available
when the peer restarts:
* The division of the IP allocation range amongst peers
* Allocation of addresses to containers on the local peer
A [data volume
container](https://docs.docker.com/engine/userguide/containers/dockervolumes/#creating-and-mounting-a-data-volume-container)
named `weavedb` is used to store this data.
**See Also**
* [Automatic Allocation Across Multiple Subnets]({{ '/tasks/ipam/allocation-multi-ipam' | relative_url }})
* [Integrating Docker via the Network Plugin (Legacy)]({{ '/install/plugin/plugin' | relative_url }})
+73
View File
@@ -0,0 +1,73 @@
---
title: Manually Specifying the IP Address of a Container
menu_order: 20
search_type: Documentation
---
Containers are automatically allocated an IP address that is unique across the Weave network. You can see which address was allocated by running, [`weave ps`]({{ '/troubleshooting#weave-status' | relative_url }}):
host1$ weave ps a1
a7aee7233393 7a:44:d3:11:10:70 10.32.0.2/12
Weave Net detects when a container has exited and releases its allocated addresses so they can be re-used by the network.
See the [Automatic IP Address Management]({{ '/tasks/ipam/ipam' | relative_url }}) and also an explanation of [the basics of IP addressing]({{ '/concepts/ip-addresses' | relative_url }}) for further details.
Instead of allowing Weave Net to allocate IP addresses automatically (using IPAM), there may be instances where you need to control a particular container or a cluster by setting an IP address for it. The way to do this varies according to how containers are attached to Weave Net.
## Manually specifying an IP address when using CNI
The software making a call to CNI has to specify an allocator that allows static IPs.
For instance the [static allocator](https://github.com/containernetworking/plugins/tree/master/plugins/ipam/static)
(At the time of writing there is no straightforward way to ask Kubernetes to do this.)
## Manually specifying an IP address when using the Weave Net Docker Plugin
Docker has a flag `--ip` to specify an address, e.g.:
$ docker run --network=mynetwork --ip=172.18.0.22 ...
## Manually specifying an IP address when using the Weave Net Docker Proxy
You can specify an IP address and a network explicitly, using Classless Inter-Domain Routing or [CIDR notation](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing).
For example, we can launch a couple of containers on `$HOST1` and
`$HOST2`, respectively, with specified IP addresses, as follows...
On `$HOST1`:
host1$ docker run -e WEAVE_CIDR=10.2.1.1/24 -ti weaveworks/ubuntu
root@7ca0f6ecf59f:/#
And `$HOST2`:
host2$ docker run -e WEAVE_CIDR=10.2.1.2/24 -ti weaveworks/ubuntu
root@04c4831fafd3:/#
Then test that the container on `$HOST2` can be reached from the container on `$HOST1`:
root@7ca0f6ecf59f:/# ping -c 1 -q 10.2.1.2
PING 10.2.1.2 (10.2.1.2): 48 data bytes
--- 10.2.1.2 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 1.048/1.048/1.048/0.000 ms
And in the other direction...
root@04c4831fafd3:/# ping -c 1 -q 10.2.1.1
PING 10.2.1.1 (10.2.1.1): 48 data bytes
--- 10.2.1.1 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 1.034/1.034/1.034/0.000 ms
The IP addresses and netmasks can be set to anything, but ensure they don’t conflict with any of the IP ranges in use on the hosts or with IP addresses used by any external services to which the hosts or containers may need to connect.
Individual IP addresses given to containers must, of course, be unique. If you pick an address that the automatic allocator has already assigned a warning appears.
**See Also**
* [Managing Services - Exporting, Importing, Binding and Routing]({{ '/tasks/manage/service-management' | relative_url }})
* [Allocating IPs in a Specific Range]({{ '/tasks/ipam/configuring-weave' | relative_url }})
* [Automatic IP Address Management]({{ '/tasks/ipam/ipam' | relative_url }})
@@ -0,0 +1,61 @@
---
title: Starting, Stopping and Removing Peers
menu_order: 40
search_type: Documentation
---
You may wish to `weave stop` and re-launch to change some config or to
upgrade to a new version. Provided that the underlying protocol hasn't
changed, Weave Net picks up where it left off and learns from peers in
the network which address ranges it was previously using.
If, however, you run `weave reset` this removes the peer from the
network so if Weave Net is run again on that node it will start from
scratch.
For failed peers, the `weave rmpeer` command can be invoked to
permanently remove the ranges allocated to said peers. This allows
other peers to allocate IPs in the ranges previously owned by the
removed peers, and as such should be used with extreme caution: if the
removed peers had transferred some range of IP addresses to other
peers but this is not known to the whole network, or if some of them
later rejoin the Weave network, the same IP address may be allocated
twice.
Assume you had started the three peers in the
[overview example]({{ '/tasks/ipam/ipam' | relative_url }}), and then host3
caught fire, you can go to one of the other hosts and run:
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
'nickname' feature of Weave Net, which defaults to the local host
name. Alternatively, you can supply a peer name as shown in `weave status`.
### <a name="caution-rmpeer"></a>Caution###
Do not invoke `weave rmpeer` for the same peer on more than one
host.
The removed peer's address range cannot be left dangling and is
therefore reassigned to the peer on which `weave rmpeer` was
run. Consequently, if you run `weave rmpeer` for the same peer on more
than one host, the removed peer's address range will be owned by
multiple peers.
Once the peers detect this inconsistency, they log the error and drop
the connection that supplied the inconsistent data. The rest of the
peers will carry on with their view of the world, but the network will
not function correctly. Depending on the timing of the `rmpeer` and
the communication between peers, several peer cliques may form -
groups of peers that are talking to each other, but repeatedly drop
attempted connections with peers in other cliques.
**See Also**
* [Address Allocation with IP Address Management (IPAM)]({{ '/tasks/ipam/ipam' | relative_url }})
* [Automatic Allocation Across Multiple Subnets]({{ '/tasks/ipam/allocation-multi-ipam' | relative_url }})
* [Isolating Applications on a Weave Network]({{ '/tasks/manage/application-isolation' | relative_url }})
@@ -0,0 +1,84 @@
---
title: Troubleshooting the IP Allocator
menu_order: 50
search_type: Documentation
---
The command
weave status
reports on the current status of the weave router and IP allocator:
```
...
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]({{ '/troubleshooting#weave-status' | relative_url }}) for full details.
The 'Service: ipam' section displays the consensus state as well as
the total allocation range and default subnet. Columns are as follows:
* 'Status' - allocator state
* 'idle' - no allocation requests or claims have been made yet;
consensus is deferred until then
* 'awaiting consensus' - an attempt to achieve consensus is
ongoing, triggered by an allocation or claim request;
allocations will block. This state persists until a quorum of
peers are able to communicate amongst themselves successfully.
* 'priming' - peer is an observer and is waiting to receive IPAM
data from seeding or consensus elsewhere in the network
* 'ready' - consensus achieved; allocations proceed normally
* 'waiting for IP range grant from peers' - peer has exhausted its
agreed portion of the range and is waiting to be granted some
more
* 'all IP ranges owned by unreachable peers' - peer has exhausted
its agreed portion of the range but cannot reach anyone to ask
for more
* 'Range' - total allocation range set by `--ipalloc-range`
* 'DefaultSubnet' - default subnet set by `--ipalloc-default-subnet`
Information regarding the division of the IP allocation range amongst
peers and their reachability can be obtained with
```
$ weave status ipam
00:00:00:00:00:01(one) 349526 IPs (33.3% of total) (2 active)
00:00:00:00:00:02(two) 349525 IPs (33.3% of total)
00:00:00:00:00:03(three) 349525 IPs (33.3% of total) - unreachable!
```
Columns are as follows:
* Peer Name and Nickname
* Absolute quantity/percentage of allocation range managed by peer
* Active - number of IP addresses in use on that peer - this is only
available for the peer where you run the status command.
* Indication of unreachability. This means that the peer is not
visible (directly or indirectly) to the peer on which `weave status
ipam` was run; whilst this could be a transient condition due to a
partition, it may be because the peer has failed and needs to be
removed administratively - see [Starting, Stopping and Removing
Peers]({{ '/tasks/ipam/stop-remove-peers-ipam' | relative_url }}) for more details.
### <a name="seeded-different-peers"></a>Seeded by Different Peers
If you see the message: `IP allocation was seeded by different peers`,
this means that some Weave Net peers were initialized into one cluster
and some into another cluster; Weave Net cannot operate in this state.
To recover, you need to eliminate the IPAM data from the affected
nodes and restart. If you installed via the Kubernetes Addon, this
data will be in a file under `/var/lib/weave` on the node - delete
this file and restart the node.
For other installations, run `weave reset` and restart. Any existing
connections to containers will be lost.