Skip to content

Commit ccd9c63

Browse files
ushabelgurbalpert89
authored andcommitted
Add usage docs for IPAM resources (#1221)
* add doc for prefix * update usage doc for prefix * incorporating review comments
1 parent 0ca6389 commit ccd9c63

File tree

7 files changed

+97
-31
lines changed

7 files changed

+97
-31
lines changed

docs/proposals/01-networking-integration.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ status: implementable
99

1010
authors:
1111

12-
- @adracus
13-
- @afritzler
12+
- "@adracus"
13+
- "@afritzler"
1414

1515
reviewers:
1616

17-
- @adracus
18-
- @afritzler
19-
- @MalteJ
20-
- @guvenc
21-
- @gehoern
17+
- "@adracus"
18+
- "@afritzler"
19+
- "@MalteJ"
20+
- "@guvenc"
21+
- "@gehoern"
2222

2323
---
2424

docs/proposals/02-machine-console-access.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ status: implementable|implemented
99

1010
authors:
1111

12-
- @adracus
12+
- "@adracus"
1313

1414
reviewers:
1515

16-
- @gehoern
17-
- @afritzler
18-
- @Gchbg
16+
- "@gehoern"
17+
- "@afritzler"
18+
- "@Gchbg"
1919

2020
---
2121

docs/proposals/03-loadbalancer.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ status: implementable
99

1010
authors:
1111

12-
- @gehoern
13-
- @adracus
12+
- "@gehoern"
13+
- "@adracus"
1414

1515
reviewers:
1616

17-
- @MalteJ
18-
- @adracus
19-
- @afritzler
20-
- @guvenc
17+
- "@MalteJ"
18+
- "@adracus"
19+
- "@afritzler"
20+
- "@guvenc"
2121

2222
---
2323

docs/proposals/04-nat-gateway.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ status: implementable
99

1010
authors:
1111

12-
- @gehoern
13-
- @adracus
12+
- "@gehoern"
13+
- "@adracus"
1414

1515
reviewers:
1616

17-
- @MalteJ
18-
- @adracus
19-
- @afritzler
20-
- @guvenc
17+
- "@MalteJ"
18+
- "@adracus"
19+
- "@afritzler"
20+
- "@guvenc"
2121

2222
---
2323

docs/proposals/05-object-storage.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ status: implementable
99

1010
authors:
1111

12-
- @lukasfrank
13-
- @gehoern
12+
- "@lukasfrank"
13+
- "@gehoern"
1414

1515
reviewers:
1616

17-
- @adracus
18-
- @MalteJ
17+
- "@adracus"
18+
- "@MalteJ"
1919

2020
---
2121

docs/proposals/07-quota.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ status: implementable
99

1010
authors:
1111

12-
- @adracus
12+
- "@adracus"
1313

1414
reviewers:
1515

16-
- @afritzler
17-
- @gehoern
18-
- @ManuStoessel
16+
- "@afritzler"
17+
- "@gehoern"
18+
- "@ManuStoessel"
1919

2020
---
2121

docs/usage/ipam/prefix.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,67 @@
11
# Prefix
2+
A `Prefix` resource provides a fully integrated IP address management(IPAM) solution for `Ironcore`. It serves as a means to define IP prefixes along with prefix length to a reserved range of IP addresses. It is also possible to define child prefixes with the specified prefix length referring to the parent prefix.
3+
4+
# Example Volume Resource
5+
An example of how to define a root `Prefix` resource in `Ironcore`
6+
7+
```
8+
apiVersion: ipam.ironcore.dev/v1alpha1
9+
kind: Prefix
10+
metadata:
11+
name: root
12+
labels:
13+
root-prefix: customer-1
14+
spec:
15+
prefix: 10.0.0.0/24
16+
17+
```
18+
An example of how to define a child `Prefix` resource in `Ironcore`
19+
20+
```
21+
apiVersion: ipam.ironcore.dev/v1alpha1
22+
kind: Prefix
23+
metadata:
24+
name: child-prefix
25+
spec:
26+
ipFamily: IPv4
27+
prefixLength: 9
28+
parentSelector:
29+
matchLabels:
30+
root-prefix: customer-1
31+
32+
```
33+
(`Note`: Refer to <a href="https://github.com/ironcore-dev/ironcore/tree/main/config/samples/e2e/">E2E Examples</a> for more detailed example on IPAM to understant e2e flow)
34+
35+
# Key Fields:
36+
37+
- `ipFamily`(`string`): `ipFamily` is the IPFamily of the prefix. If unset but `prefix` is set, this can be inferred.
38+
39+
- `prefix` (`string`): `prefix` is the IP prefix to allocate for this Prefix.
40+
41+
- `prefixLength` (`int`): `prefixLength` is the length of prefix to allocate for this Prefix.
42+
43+
- `parentRef` (`string`): `parentRef` references the parent to allocate the Prefix from. If `parentRef` and `parentSelector` is empty, the Prefix is considered a root prefix and thus allocated by itself.
44+
45+
- `parentSelector` (`LabelSelector`): `parentSelector` is the LabelSelector to use for determining the parent for this Prefix.
46+
47+
48+
# Reconciliation Process:
49+
50+
- **Allocate root prefix**: If `parentRef` and `parentSelector` is empty, the PrefixController reconciler considers it as a root prefix and allocates by itself and the status is updated as `Allocated`.
51+
52+
- **Allocating sub-prefix**: If `parentRef` or `parentSelector` is set PrefixController lists all the previously allocated prefix allocations by parent prefix. Finds all the active allocations and prunes outdated ones. If no existing PrefixAllocation object is found new `PrefixAllocation` object is created for the new prefix to allocate. If prefix allocation is successful status is updated to `Allocated` otherwise to `Failed`.
53+
54+
- **Prefix allocation scheduler**: `PrefixAllocationScheduler` continuously watches for Prefix resource and tries to schedule all PrefixAllocation objects for which prefix is not yet allocated. PrefixAllocationScheduler determines suitable prefix for allocation by listing available prefixes based on label filter, namespace and desired IP family. Once a suitable prefix is found PrefixAllocation spec.parentRef is updated with the selected prefix reference.
55+
56+
- **Status update**: Once prefix allocation is successful status is updated to `Allocated`. In the case of sub-prefixes once the prefix is allocated `PrefixController` updates the parent Prefix's status with the used prefix IPs list.
57+
58+
Below is the sample `Prefix.status` :
59+
60+
```
61+
status:
62+
lastPhaseTransitionTime: "2024-10-21T20:56:24Z"
63+
phase: Allocated
64+
used:
65+
- 10.0.0.1/32
66+
- 10.0.0.2/32
67+
```

0 commit comments

Comments
 (0)