-
Notifications
You must be signed in to change notification settings - Fork 11
Add usage docs for IPAM resources #1221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
afritzler
merged 3 commits into
ironcore-dev:main
from
opensovereigncloud:osc/enh/doc_ipam_core
Feb 4, 2025
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,67 @@ | ||
| # Prefix | ||
| 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. | ||
|
|
||
| # Example Volume Resource | ||
| An example of how to define a root `Prefix` resource in `Ironcore` | ||
|
|
||
| ``` | ||
| apiVersion: ipam.ironcore.dev/v1alpha1 | ||
| kind: Prefix | ||
| metadata: | ||
| name: root | ||
| labels: | ||
| root-prefix: customer-1 | ||
| spec: | ||
| prefix: 10.0.0.0/24 | ||
|
|
||
| ``` | ||
| An example of how to define a child `Prefix` resource in `Ironcore` | ||
|
|
||
| ``` | ||
| apiVersion: ipam.ironcore.dev/v1alpha1 | ||
| kind: Prefix | ||
| metadata: | ||
| name: child-prefix | ||
| spec: | ||
| ipFamily: IPv4 | ||
| prefixLength: 9 | ||
| parentSelector: | ||
| matchLabels: | ||
| root-prefix: customer-1 | ||
|
|
||
| ``` | ||
| (`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) | ||
|
|
||
| # Key Fields: | ||
|
|
||
| - `ipFamily`(`string`): `ipFamily` is the IPFamily of the prefix. If unset but `prefix` is set, this can be inferred. | ||
|
|
||
| - `prefix` (`string`): `prefix` is the IP prefix to allocate for this Prefix. | ||
|
|
||
| - `prefixLength` (`int`): `prefixLength` is the length of prefix to allocate for this Prefix. | ||
|
|
||
| - `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. | ||
|
|
||
| - `parentSelector` (`LabelSelector`): `parentSelector` is the LabelSelector to use for determining the parent for this Prefix. | ||
|
|
||
|
|
||
| # Reconciliation Process: | ||
|
|
||
| - **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`. | ||
|
|
||
| - **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`. | ||
|
|
||
| - **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. | ||
|
|
||
| - **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. | ||
|
|
||
| Below is the sample `Prefix.status` : | ||
|
|
||
| ``` | ||
| status: | ||
| lastPhaseTransitionTime: "2024-10-21T20:56:24Z" | ||
| phase: Allocated | ||
| used: | ||
| - 10.0.0.1/32 | ||
| - 10.0.0.2/32 | ||
| ``` | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.