Skip to content

Conversation

@thatmattlong
Copy link
Collaborator

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 bufferSize is 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 a threshold?

@thatmattlong thatmattlong requested a review from pjohnst5 May 28, 2020 17:12
@codecov
Copy link

codecov bot commented May 28, 2020

Codecov Report

Merging #570 into master will increase coverage by 3.31%.
The diff coverage is n/a.

@@            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     

Copy link
Member

@paulgmiller paulgmiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
Adding as a refernce for what I'm expecting.

Copy link
Contributor

@ramiro-gamarra ramiro-gamarra left a 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 {
Copy link
Contributor

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.

Copy link
Collaborator Author

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?

neaggarwMS
neaggarwMS previously approved these changes May 29, 2020

// NodeNetworkConfigStatus defines the observed state of NetworkConfig
type NodeNetworkConfigStatus struct {
AssignedIPCount int64 `json:"assignedIPCount,omitempty"`
Copy link
Member

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 :)

Copy link
Collaborator Author

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.

Copy link
Member

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"`
Copy link
Member

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

Copy link
Member

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.

Copy link
Collaborator Author

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"`
Copy link
Member

@paulgmiller paulgmiller May 29, 2020

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 }

Copy link
Collaborator Author

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.

@matmerr
Copy link
Member

matmerr commented Jun 1, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@thatmattlong
Copy link
Collaborator Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@thatmattlong thatmattlong requested a review from neaggarwMS June 1, 2020 20:00

// NodeNetworkConfigStatus defines the observed state of NetworkConfig
type NodeNetworkConfigStatus struct {
AssignedIPCount int64 `json:"assignedIPCount,omitempty"`
Copy link
Member

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"`
Copy link
Member

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

@thatmattlong
Copy link
Collaborator Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@thatmattlong thatmattlong merged commit 9e15490 into Azure:master Jun 2, 2020
@thatmattlong thatmattlong deleted the networkconfig branch June 2, 2020 22:14
tamilmani1989 pushed a commit to tamilmani1989/azure-container-networking that referenced this pull request Jun 20, 2021
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants