* Add CNS API to retrieve VMUniqueID from IMDS
* Address the PR review comments
* Address the security comment from Evans to expose this API wherever needed
* fixed the linter error
* address the PR comments from Matt
* lowercase the struct json fields
* Modyfying stateless CNI state to account for swift 2.0 changes
* Removing SecondaryNICInfor fro EPInfo.
* removing SecondaryNic from the epInfo.
* Make change to UpdateEndpointState API to support SwiftV2 for Stateless CNI
* updating Makefile to include azure CNI binary.
* refractor: swift v2 middleware
* revert: unexport getTestService
* fix: linter
* fix: linter issue
* refactor: generic renaming of middlewares-related code in cns
* refactor: change type of swiftv2middleware
* address feedbacks
* rename for clarity
* missed some renaming
* renaming
* addressed comments
* add UT for no-op releasing ip config for v2 pod even if its mtpnc is not ready
* pass in SWIFTv2Mode as string
* typed SWIFTV2Mode
* feat: 🌈 StatelessCNI: Adding getEndpoint and UpdateEndpoint API to CNS (#2102)
* Adding getEndpoint and UpdateEndpoint API to CNS with the respective clients in support of stateless CNI.
* Updating the unit tests and address the comments.
* Addressing the comments.
* Addressing the coments regarding CNS support for Stateless CNI
* Adddressing the PR comments
* 🌈 feat: adding flags for stateless cni (#2103)
feat: stateless cni
* 🌈 feat: StatelessCNI: Applying stateless CNI mode changes in network package. (#2197)
* Apllying stateless CNI mode in network package.
* Addresing the commetns.
* feat: create stateless cni binary for swift (#2275)
* enabling CNS telemetry
* Master rebase changes
* CNI Telemetry enabled on CNS
* Stateless CNI changes.
* making change to CNSendpointStorePath
* Updating makefile to avoid creating statless CNI release.
---------
Co-authored-by: Vipul Singh <vipul21sept@gmail.com>
* fix overlay IPAM not reporting version
* revert file and var naming, add correct path to makefile
* proposal design for multitenant IPAM flow
* change podipinfo + linter issue
* pointer issues for printf
* update IPAM branching
* remove comments
* pod client placeholder
* address lint issue for httpservicefake
* getting pod info in validator
* linter issue
* update network container contract
* renaming
* mtpnc changes
* rebase
* revert file and var naming, add correct path to makefile
* add default route
* add unit tests
* update unit tests for ipam
* go get to fix linter
* go mod tidy
* update routes
* update routes
* remove stale comments + remove redundant method
* add contexts + change address type
* addressed review
* embedded client to mock + enum for address type
* fix error
* change addressType to NICType
* change isDefaultRoute to SkipDefaultRoutes
* address comments
* refractor: make changes according to cni/cns contract
* refractor: make adding route its own func + move swift v2 ipam branching to after normal ipam flow
* refractor: change vars naming
* refractor: more var naming
* test: add test for podv6cidr
* refractor: make the returning podIpInfo init cleaner in swiftv2.go
* refractor + tests: add contexts to ipconfigs req validators + set route tests
* refractor: change labels for swift v2 pods
* fix: fix swift v2 UT
* refractor: add v4/v6 distinction for service cidr
* rebase
* revert file and var naming, add correct path to makefile
* rebase
* revert file and var naming, add correct path to makefile
* change podipinfo + linter issue
* update IPAM branching
* pod client placeholder
* getting pod info in validator
* linter issue
* rebase
* revert file and var naming, add correct path to makefile
* refractor: fix conflicts
* refractor: revert podwatcher code changes
* docs: change comment
* refractor: change CIDR to CDIRs
* refractor: parse CIDRs as semicolons separated string from env in SetRoutes
* docs: add minor comment
* refractor: change separator for parsing CIDRs
* feat: add rbac roles
* fix: gofumpt
* fix: update clusterrole
* fix: add namespace to clusterrolebinding
* fix: UT
* fix: add labels toswift v2 clusterrole
* fix: release default ipconfig early if getting swiftv2 ipconfig failed
* test: add more UT
* fix: parsing MTPNC as CIDR instead
* fix: toggle skipDefaultRoutes for infraNic to true
* fix: add route for node cidr in ipv4 podipconfig
* feat: add node cidrs route
* fix: linter
* address comments
* fix: minor logs formatting
* feat: move cns yaml for swiftv2 scenario to a diff file + more logging for swiftv2middleware
* fix: log debugf to printf
* fix: add testmain to avoid nil pointer error for loggers
* Update azure-cns.yaml
Signed-off-by: Quang Nguyen <nguyenquang@microsoft.com>
* fix: move parseCIDRs to a common package, use net/netip instead of net
* fix: exhaustive all switch case for nic type
* fix: exhaustive all switch case for nic type
* refractor: change fmt.Errorf to errors.Wrapf
* fix: add mtpnc status check in validator + use netip package
* fix: minor
* revert: azure-cns.yaml
---------
Signed-off-by: Quang Nguyen <nddangquang@gmail.com>
Signed-off-by: Quang Nguyen <nguyenquang@microsoft.com>
This commit has following changes -
1. Removed AllocatedIPCount field from HTTPRestService
struct in restserver.go as it is not used in project.
2. Added debug command getInMemory and API to expose
fields-HTTPRestService and 2 fields from IPAMPoolMonitor.
Please review the naming of the command, handler and end
point.
3. Added Test function to test the new api response.
4. Added changes as per review comments - Get request
for Test endpoint.
The GetIPAddressesMatchingStates now returns IPConfigurationStatus
type, which also includes PodInfo along with IP address and state
fix : minor formatting
* Add pending program status for IPs in CNS.
Add logic structure of how to update program status.
* Add missing NCVersion CreateNetworkContainerRequest in commit.
* Add missing fake GetPendingProgramIPConfigs to unblock ipam pool unit test.
* Address feedbacks.
* Modify function parameter to meet current unit test requirement.
* Add updating secondary IPs to pending programming status logic.
* Add ip state update when CRD status change.
* Update NC ID.
* Update NC ID.
* Update comments.
* Remove NC version compare and update logic. This logic will be moved to a background thread.
* Update comments accordingly.
* Add unit test.
* Update nmagent version in test.
* Update function name.
* init with test framework
* handle multiple batch size pool request
* test verification
* handle batch size multiples
* address feedback
* fix test
* remove test struct from fakes
* fix nil test
* fix tests
* feedback
* scale down
* init scale down
scale down testing
test work
reconcile fake requestcontroller
test revision
check for cached nonreleased ipconfigs
remove test struct from decrease fakes
initial integration
fix interface signature
test get pending release
futher integration tseting
test fixes
* start feedback
* update request controller
* fixed tests
* test fix
* ipampoolmonitor in cns not request controller
* init fake ipam pool monitor
This PR adds support for host NC bidirectional communication with windows HnsV2. This is supported in multitenant scenario only. AllowHostToNCCommunication and AllowNCToHostCommunication flags are used to enable Host to NC and NC to host communication respectively.
* Add option in CNS to pre-provision hns network
Add a commandline option in CNS to pre-provision hns network.
The commandline option take the type of the network that needs
pre-provisioning. This allows orchestrators to start CNS with this
option so that the VM network blip / disconnect is avoided when
calling cni add the very first time.
* APIs to support multitenancy in Azure.
* Add support to create, update, and delete network containers (adapters) in windows hosts
* Add API to query host for programmed version of a container
* Add API to retrieve interface given a container ID
* Add support for custom log directory.
* Creates container network service (CNS): A service that exposes a set of REST API calls to support/manage networking for containers in Windows and Linux hosts. It currently requires docker daemon to be running on the node, as well as azure-vnet plugins for IPAM and Network.
Supported Scenarios: Windows/Azure
Future Scenarios: Linux/Azure, Windows/Overlay, Linux/Overlay