-
Notifications
You must be signed in to change notification settings - Fork 260
Feature proposal: subnet scarcity phase 1 #1659
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
Merged
Changes from all commits
Commits
Show all changes
2 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,38 @@ | ||
| TODO | ||
| # DNC-RC watches and reacts to exhaustion [[Phase 1 Design]](../proposal.md#1-2-subnet-exhaustion-is-calculated-by-dnc-rc) | ||
|
|
||
| DNC-RC will poll the `SubnetState` API to periodically check the Subnet utilization. DNC-RC will be configured with a lower and upper threshold ( $T_l$ and $T_u$ ) as percentages of the Subnet capacity $C$. If the Subnet utilization $U$ crosses the upper threshold, DNC-RC will consider the Subnet "exhausted". If the Subnet utilization then falls below the lower threshold, DNC-RC will consider the Subnet "not exhausted". Two values are necessary to induce hysteresis and minimize oscillation between the two states. | ||
|
|
||
| $$ | ||
| E = \neg E \text{ when}\begin{cases} | ||
| U \gt T_u \times C &\text{if } E \text{ is true}\\ | ||
| U \lt T_l \times C &\text{if } E \text{ is false} | ||
| \end{cases} | ||
| $$ | ||
|
|
||
| > Note: $\neg$ is the negation operator. | ||
|
|
||
| If the Subnet is exhausted, DNC-RC will write an additional, per-subnet CRD, the [`ClusterSubnetState`](https://github.com/Azure/azure-container-networking/blob/master/crd/clustersubnetstate/api/v1alpha1/clustersubnetstate.go), with a Status of `exhausted=true`. When the Subnet is un-exhausted, DNC-RC will write the Status as `exhausted=false`. | ||
|
|
||
| ```yaml | ||
| apiVersion: acn.azure.com/v1alpha1 | ||
| kind: ClusterSubnet | ||
| metadata: | ||
| name: subnet | ||
| namespace: kube-system | ||
| status: | ||
| exhausted: true | ||
| timestamp: 123456789 | ||
| ``` | ||
|
|
||
| ```mermaid | ||
| sequenceDiagram | ||
| participant Kubernetes | ||
| participant RC | ||
| participant DNC | ||
| loop | ||
| RC->>+DNC: Query Subnet Utilization | ||
| DNC->>-RC: Utilization | ||
| RC->>RC: Calculate Exhaustion | ||
| RC->>Kubernetes: Write Exhaustion to ClusterSubnet CRD | ||
| end | ||
| ``` | ||
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,22 @@ | ||
| TODO | ||
| # CNS releases IPs back to Exhausted Subnets [[Phase 1 Design]](../proposal.md#1-3-ips-are-released-by-cns) | ||
|
|
||
| CNS will watch the `ClusterSubnetState` CRD and will update its internal state with the Subnet's exhaustion status. When the Subnet is exhausted, CNS will ignore the configured Batch size from the `NodeNetworkConfig`, and internally will use a Batch size of $1$. As the IPAM Pool Monitor reconciles the Pool, the changes to the Batch size will get picked up and applied to the subsequent Pool Scaling and target `RequestedIPCount`. | ||
|
|
||
| ```mermaid | ||
| sequenceDiagram | ||
| participant IPAM Pool Monitor | ||
| participant ClusterSubnet Watcher | ||
| participant Kubernetes | ||
| Kubernetes->>ClusterSubnet Watcher: ClusterSubnet Update | ||
| alt Exhausted | ||
| ClusterSubnet Watcher->>IPAM Pool Monitor: Batch size = 1 | ||
| else Un-exhausted | ||
| ClusterSubnet Watcher->>IPAM Pool Monitor: Batch size = 16 | ||
| end | ||
| loop | ||
| IPAM Pool Monitor->>IPAM Pool Monitor: Recalculate RequestedIPCount | ||
| Note right of IPAM Pool Monitor: Request = Batch * X | ||
| IPAM Pool Monitor->>Kubernetes: Update NodeNetworkConfig CRD Spec | ||
| Kubernetes->>IPAM Pool Monitor: Update NodeNetworkConfig CRD Status | ||
| end | ||
| ``` |
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 was deleted.
Oops, something went wrong.
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
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.