-
Notifications
You must be signed in to change notification settings - Fork 260
NetworkConfig CRD defintions #570
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #570 +/- ##
==========================================
+ Coverage 49.22% 52.54% +3.31%
==========================================
Files 28 23 -5
Lines 3437 2845 -592
==========================================
- Hits 1692 1495 -197
+ Misses 1455 1077 -378
+ Partials 290 273 -17 |
paulgmiller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ramiro-gamarra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some food for thought.
| // Important: Run "make" to regenerate code after modifying this file | ||
|
|
||
| // AvailableIPMapping groups an IP address and Name. This is a struct and not a Map for future extensibility | ||
| type AvailableIPMapping struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this doesn't need to be qualified as "available" or a "mapping"? It could just be an IP struct. The availability is signaled by its inclusion in AvailableIPs below. Thinking a bit more about it, what about DelegatedIP or something like that? I feel like mentioning its delegated might help explain why it has a UUID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to call it an IP because this fundamentally represents an IP allocation, since an IP address could be allocated to this node, deallocated, then reallocated under a different "IP allocation". Similarly, deletions happen via the IP allocation's UUID, not IP. How about IPAllocation instead of AvailableIPMapping?
|
|
||
| // NodeNetworkConfigStatus defines the observed state of NetworkConfig | ||
| type NodeNetworkConfigStatus struct { | ||
| AssignedIPCount int64 `json:"assignedIPCount,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the assigned up count here and in network container seem unnecessary can just len() IpAssignments. It's a slice not a stream :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@neaggarwMS wanted these for easier debugging/ops. If you don't object @paulgmiller, I'll leave them in. If you do, we can discuss with Neha.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is added for debugging purpose specially during devops. Lets discuss this in today's syncup
| BatchSize int64 `json:"batchSize,omitempty"` | ||
| ReleaseThresholdPercent int64 `json:"releaseThresholdPercent,omitempty"` | ||
| RequestThresholdPercent int64 `json:"requestThresholdPercent,omitempty"` | ||
| NetworkContainers []NetworkContainer `json:"networkContainers,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we give an example if why we'd have multiple network containers on a single node? i
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would a single node have different different primary ips and different subnets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now we are planning one NC per node and thus one primary IP and one subnet. However, this imposes a limit on the number of IPs, so we want to support multiple NCs in the future. It will be easier to add multi-NC support when we can support it on the other tooling if the CRD already supports it.
| IPAssignments []IPAssignment `json:"iPAssignments,omitempty"` | ||
| AssignedIPCount int64 `json:"assignedIPCount,omitempty"` | ||
| DefaultGateway string `json:"defaultGateway,omitempty"` | ||
| Netmask string `json:"netmask,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is a mask is the subnet an id? more comments explaining the relation ship between these might be nice. or group them into a struct subnet { id , mask }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An NC can have only one subnet. I'll make this subnetId.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
|
||
| // NodeNetworkConfigStatus defines the observed state of NetworkConfig | ||
| type NodeNetworkConfigStatus struct { | ||
| AssignedIPCount int64 `json:"assignedIPCount,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is added for debugging purpose specially during devops. Lets discuss this in today's syncup
| // NodeNetworkConfigStatus defines the observed state of NetworkConfig | ||
| type NodeNetworkConfigStatus struct { | ||
| AssignedIPCount int64 `json:"assignedIPCount,omitempty"` | ||
| BatchSize int64 `json:"batchSize,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move these batchSize, Release and Request threshold in some other struct for code readiblity? Also, In case we need to extend it, it wont change the main struct
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This pull request adds a new binary, `requestcontroller` to watch the Nodes of a Kubernetes cluster so that it can create a [NodeNetworkConfig](Azure#570) CRD object for each Node on Node creation, and delete it on Node deletion. **To Do:** - [X] Update Makefile to build - [X] Add tests - [X] Discuss the use of [finalizers](https://book.kubebuilder.io/reference/using-finalizers.html). This PR uses them currently, but need to discuss with AKS team. - [ ] Add task to pipeline to build/test PR URL: https://msazure.visualstudio.com/DefaultCollection/One/_git/Networking-Aquarius/pullrequest/2980584 Related work items: #7207918, #7208644

What this PR does / why we need it:
This PR adds definitions for the NetworkConfig CRD that will be used to pass goal state to CNS
Special notes for your reviewer:
We need to confirm that only
bufferSizeis passed to CNS via the status, and no other options regarding the pool of allocated IP addresses. In other words, is CNS responsible for setting its own thresholds based on the buffer size, or should we also pass it athreshold?