Adam Harrison
915638d17a
Address linter failures
2016-11-14 15:13:19 +00:00
Marc CARRE
0544901357
Factorise "_" duplicates as a constant.
2016-11-11 17:00:26 +00:00
Marc CARRE
bc94633180
Re-claim IP on start-up when an existing ID has been found.
...
- Rewrote conditions to keep c.ident immutable and hopefully makes
things clearer.
- Added a case to tolerate reclaim after we have used CNI (passed CID
is “_” and existing CID is a real container ID).
2016-11-11 17:00:26 +00:00
Bryan Boreham
6d5af85eee
Report count of active IP addresses in status
2016-10-20 14:04:41 +01:00
Bryan Boreham
1ae2d33714
Remove old-style 'expvar' metrics
2016-10-20 13:54:42 +01:00
Martynas Pumputis
58caf38f07
Fix re-attaching of weave router in awsvpc mode
...
In order to re-attach the router and make it work in awsvpc mode,
the following has to be done:
- expose_ip on the router
- adjusting arp settings
- restoring host routes
To detect that we run in awsvpc mode, we inspect cmd parameters
of the weave router instead of GET'ing /ipinfo/tracker. This is so,
because the HTTP server started by the router might not be running
at the time of restoration.
2016-06-29 11:15:49 +01:00
Martynas Pumputis
8569cbd4a3
Force transferring of IPAM ranges in a case of Shutdown
...
If no peer for transfer is found, we transfer them to
mesh.UnknownPeerName to notify the ring update tracker.
Makes the awsvpc tracker to remove local entries from
the VPC route table when the last peer calls "weave reset".
2016-06-10 11:51:31 +01:00
Adam Harrison
adcb1018df
Merge pull request #2345 from weaveworks/issues/2344-persist-more
...
Fix ring persistence after free space update
2016-06-09 16:37:57 +01:00
Martynas Pumputis
de2a70861c
Add GET /ipinfo/tracker
...
The endpoint returns the name of tracker. It is used to determine
whether the router is running a tracker.
2016-06-08 16:44:54 +01:00
Martynas Pumputis
9fc7be83c8
Create a Tracker when starting the router
...
The tracker's HandleUpdate method is called by the ring update routines.
In addition, we add a dummy overlay for AWSVPC to make `weave (status|
report)` to produce reasonable reports which includes AWS hosts
connection state.
2016-06-08 16:44:54 +01:00
Martynas Pumputis
c260536429
Add AWSVPC Tracker
...
The tracker is responsible for managing the AWSVPC route tables
which is used to implement the underlay routing based on VPC.
2016-06-08 16:44:54 +01:00
Martynas Pumputis
59b3a3c8c5
Add the Tracker interface
...
An instance of the interface must implement the HandleUpdate method
which (in the future) will be called when any change to the IPAM ring
occurs.
2016-06-08 16:44:54 +01:00
Martynas Pumputis
49f2e208c3
Make ClaimForPeers to claim CIDR-aligned ranges
2016-06-08 16:44:54 +01:00
Bryan Boreham
d1bba977f3
Don't stop reporting free space at the first unchanged range
2016-06-08 11:53:35 +01:00
Bryan Boreham
e2bee6e8c6
Persist ring after updates caused by reportFreeSpace()
2016-06-08 11:52:38 +01:00
Bryan Boreham
1d91c1a23b
Cleanup: change ring test from 255 to 256 in length, which is more realistic
2016-06-01 17:51:21 +01:00
Martynas Pumputis
f50fbc002e
Change ipam Universe from Range to CIDR
...
There was no code to initialize it as anything else, and this lets us
bake in an assumption that it will always be a CIDR.
2016-06-01 17:06:31 +01:00
Adam Harrison
f02b78ed73
Merge branch '1.5'
...
Closes #2282
2016-05-26 16:16:54 +01:00
Bryan Boreham
cda1084777
Check validity of IP subnets
...
Be more consistent about this - check in the same way whether at startup
or during allocation.
2016-05-26 14:31:17 +00:00
Martynas Pumputis
85cea672d3
Change the type of entry.Free to address.Count
...
This change is backward compatible, because the underlying types of
address.Offset (the previous type) and address.Count are the same
and the Gob encoder does not require types to exactly correspond.
2016-05-16 15:03:05 +01:00
Bryan Boreham
d551b6b0a8
Review feedback
2016-05-13 16:27:28 +01:00
Bryan Boreham
1ec2c0fb3f
Use a CIDR-aligned CIDR in unit tests
2016-05-13 16:27:28 +01:00
Bryan Boreham
64dc7a1f69
Donate power-of-2-aligned ranges instead of just slicing at the mid-point.
...
Also fix up space tests to match.
2016-05-13 16:27:28 +01:00
Martynas Pumputis
178438c470
Merge branch '1.5'
2016-05-10 17:36:56 +01:00
Martynas Pumputis
632694472c
Merge pull request #2281 from weaveworks/issues/2275-request-order
...
Ignore IPAM requests for space until we have a ring
Fixes #2275
2016-05-10 17:36:26 +01:00
Martynas Pumputis
14e1145972
Merge branch '1.5'
2016-05-10 17:34:08 +01:00
Bryan Boreham
16b75f899e
Move sleep on reset from IPAM Allocator to weave script
2016-05-10 16:03:08 +01:00
Bryan Boreham
c3abe4f7b2
If we don't have a ring, just ignore a request for space.
2016-05-10 15:33:13 +01:00
Martynas Pumputis
f7bddab4cb
Merge branch '1.5'
2016-05-10 15:27:15 +01:00
Martynas Pumputis
c434345960
Fix typo
2016-05-10 15:24:38 +01:00
Martynas Pumputis
f9157acced
Fix logging
2016-05-10 15:18:10 +01:00
Bryan Boreham
de9597b6fa
Merge branch '1.5'
2016-05-09 14:38:00 +01:00
Martynas Pumputis
d698aefbfc
Make Claim to block if the IPAM ring is not established
2016-05-09 12:48:41 +01:00
Matthias Radestock
438efcccda
Merge branch '1.5'
2016-05-07 20:19:18 +01:00
Matthias Radestock
daa369b86c
refactor: extract a couple of helpers in allocator tests
...
to reduce repetition
2016-05-07 20:18:21 +01:00
Matthias Radestock
32ba82efaf
Merge branch '1.5'
2016-05-05 14:50:00 +01:00
Matthias Radestock
b1aa52b3ed
Merge pull request #2238 from weaveworks/missing-persist
...
Persist the IPAM ring on `weave reset` and `weave rmpeer`
2016-05-05 14:41:53 +01:00
Adam Harrison
34b95ee36f
Merge branch '1.5'
2016-05-05 10:11:50 +01:00
Adam Harrison
1283ba4f61
Merge pull request #2249 from weaveworks/issues/2209-depersist-on-range-change
...
Better deleting of persisted IPAM data
2016-05-05 10:11:22 +01:00
Adam Harrison
5fb6df5219
Merge branch '1.5'
2016-05-04 13:34:06 +01:00
Bryan Boreham
3252a25e00
Broadcast initial ring after persisting it, in case we die between those operations
2016-05-03 17:23:00 +01:00
Bryan Boreham
6847a3551d
Persist the ring in Shutdown() and AdminTakeoverRanges().
...
Also make AdminTakeoverRanges cause pending ops to be retried.
2016-05-03 17:23:00 +01:00
Bryan Boreham
70bd0ade45
Identifier "_" is address, not cidr
2016-05-03 15:47:45 +01:00
Bryan Boreham
8405e0759a
Clarify the function of the periodic ticker.
...
- it either retries for consensus or retries operations we would have tried previously.
There is no point retrying pending operations if we are waiting for consensus.
2016-05-03 15:13:20 +01:00
Bryan Boreham
5ac8cc74d3
Refactor nested if-statements as switch
2016-05-03 13:52:36 +01:00
Bryan Boreham
f6966548eb
Delete persisted data when IPAM range changes
2016-05-03 13:20:04 +01:00
Bryan Boreham
fb3ed9c1a6
Re-organise checking of persisted data so the failure paths bail out
...
of the function first.
Also bail out if there is no persisted ring, since persisted 'owned'
data isn't meaningful in that state.
2016-05-03 13:20:04 +01:00
Bryan Boreham
61fc5d56fb
Refactor: move initialisation in the case that we don't use persisted data
...
out from loadPersistedData().
2016-05-03 13:20:04 +01:00
Bryan Boreham
e96b68f0aa
Don't use persisted data until we are sure it matches
2016-05-03 13:20:04 +01:00
Bryan Boreham
27bdd3b4ad
Revert "Log the error when something goes wrong requesting a claimed address"
...
This reverts commit 14bc1c987e .
2016-04-29 16:03:41 +01:00