Skip to content

Commit 4e7ac39

Browse files
authored
Merge pull request #96 from aateem/document-auto-allocation
Add description and demo for exteranl IPs auto allocation
2 parents 91642d6 + 03507e2 commit 4e7ac39

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,52 @@ External ip controller [![Build Status](https://travis-ci.org/Mirantis/k8s-exter
33

44
[![asciicast](https://asciinema.org/a/95449.png)](https://asciinema.org/a/95449)
55

6+
Auto allocation of external IPs
7+
===============================
8+
9+
Now users can utilize auto allocation feature.
10+
11+
In order to do that they must first provide
12+
IP pool for the allocator by creation of IpClaimPool resources.
13+
Here is example description for one in yaml format
14+
15+
```yaml
16+
apiVersion: ipcontroller.ext/v1
17+
kind: IpClaimPool
18+
metadata:
19+
name: test-pool
20+
spec:
21+
cidr: 192.168.0.248/29
22+
ranges:
23+
- - 192.168.0.249
24+
- 192.168.0.250
25+
- - 192.168.0.252
26+
- 192.168.0.253
27+
```
28+
29+
Few words about the Spec: CIDR is mandatory to supply.
30+
Ranges can be omitted (range of the whole network defined in "CIDR" field is used then).
31+
Exclusion of particular addresses is done via specifying multiple ranges.
32+
In example above address 192.168.0.251 is not processed by the allocator.
33+
34+
In order to enable auto allocation for particular services users
35+
must annotate them with following key-value pair - "external-ip = auto"
36+
either on creation or while the service is running (via `kubectl annotate`).
37+
After that there will be allocated exactly one external IP address for the service
38+
and IP claim will be created. Allocated address is then stored in 'allocated' field of pool
39+
object.
40+
41+
Users can create several IP pools. Allocator will process all of them in the same manner
42+
(looking for first available IP) and with no regard for order, that is users cannot control
43+
which pool an address is fetched from.
44+
45+
When service is deleted allocation is freed and returned to the pool of usable addresses
46+
again. Corresponding IP claim is removed.
47+
48+
Here is a brief demo of the functionality.
49+
50+
[![asciicast](https://asciinema.org/a/6uyrkfn66nufzpuhrwt1veshb.png)](https://asciinema.org/a/6uyrkfn66nufzpuhrwt1veshb)
51+
652
How to run tests?
753
================
854

examples/ip-pool.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: ipcontroller.ext/v1
2+
kind: IpClaimPool
3+
metadata:
4+
name: test-pool
5+
spec:
6+
cidr: 192.168.0.248/29
7+
ranges:
8+
- - 192.168.0.249
9+
- 192.168.0.250
10+
- - 192.168.0.252
11+
- 192.168.0.253

0 commit comments

Comments
 (0)