* add new dockerfile for testing cni-dropgz
* add make targets for cni-dropgz-test manifest
* modify versioning in cni-dropgz-test manifest
* platform versioning for test image
* fix build of test image
* update go version for dropgz
* building vnet-ipam and vnet-telemetry
* copy azure-vnet* to grab all vnet binaries
* modify build for vnet-ipam
* fix copying of cns conflist
* Added a metric to monitor the subnet exhaustion state within the Ipam Monitor Pool
* Fixed the PR comments
* Added a reconciler error metric
* Addressed code review comments
* Updating lint on code
* Addressed all code review comments and changed the reconciler metric to a counter metric and fixed linting issues
* Added a count metric for IPAM pool as well to count the number of switches between subnet exhaustion and reversal for each subnet
* Updated the makefile to be able to run linting with better garbage collection
* Updated the code with the PR review comments
* Updated the label values based on a discussion offline with Evan
Co-authored-by: asn <asn@microsoft.com>
* use submodule specific tags
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
* support separate go submodule versions
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
* move version and tag responsibilities to the makefile
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
* update integration tests to use component tags
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
exclude tags for go submodules when buliding repo version
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
* Native Endpoint Client Add Endpoints
* AddEndpointRules, ConfigureContainerInterfacesAndRoutes
* Changed interface names, log statements
nw.extIf.Name > eth0 (eth0)
eth0.vlanid > eth0.X (eth0.1)
%s%s hostIfName > vnet (A1veth0)
%s%s-2 contIfName > container (B1veth0)
* Renaming, using lib to set ns
* Namespace "path" is /var/run/netns/<NS>
* Loopback set up, Remove auto kernel subnet route
* Cannot set link to up if it's in another NS
* Multiple containers on same VNET NS
* Delete Endpoint routes on Delete
* Minimizing netns usage
* Moving NS Exec Code
* Further minimized netns.Set usage
* Moved helper methods down, drafted tests
* Removed DevName from Route Info, more tests
* Test existing vnet ns, delete endpoint
* NetNS interface for testing
* Separated tests by namespace
* Endpoints delete if they cannot be moved into NS
* Namespace netns tests
* Added Native Client to deleteEndpointImpl
* Deletion of Endpoints Impl and Tests
* Cleaned code (Tests ok)
* Moved mock/netns to package (Tests ok)
* Fixing Netns (wip)
Moved netnsinterface to consumer package (network).
Removed "Netns" from "NewNetns" and "NewMockNetns" as it is unambiguous.
Changed uintptr to int and casted the int to uintptr when needed later.
* Using errors.Wrap for error context (wip)
* Removed sentence case (wip)
* Removing variable predeclaration
* Removed NewNativeEndpointClient
Directly instantiating struct because nothing special happens in NewNativeEndpointClient
* Removed generics from ExecuteInNS
* Removed uintptr from mocknetns, tests compile
Forgot to remove uintptr from mocknetns
* Fix tests, lint
* Fixes from linter
Works on VMSS
* Replacing references to ethX with vlan veth
* Removed unnecessary log
* Removed unnecessary mac, fix tests
* Mockns method name enum
* Unable to use GetNetworkInterfaceByName due to NS
If I use GetNetworkInterface, I need to be in the vnet NS, but that means I will need to call ExecuteInNS, which causes tests to fail.
* Fixes from linter
* Assume if NS exists, vlan veth exists
Tests ok
* Fixes for Linter
* Snat refactor
* Fix delete tests
* Fix delete tests bug
* More snat refactor
* Breaking, prepping for Native Snat
Delete native endpoint snat route linux to remove errors and in theory, ovs should work fine again.
* Go mod tidy for linting
Hopefully this fixes the windows lint error
* Add fields to native endpoint client for snat
* Using New() func to create Native Client
Creation of the native endpoint client is too complicated to directly instantiate.
* Snat defaults
* Insert SNAT entry points
* Native Snat error handling
* Breaking, decouple ovsctl from snat
Proposed Solution implementation
Moved ovsctlClient.AddPortOnOVSBridge to ovs_endpoint_snatroute_linux.go. Removed ovsctlclient from NewSnatClient. Removed ovsctlClient from testing file.
* Delete unecessary ovssnat files
* No lint on vishvananda netns
Maybe this will fix the windows linter?
* Build linux only for netns package
Maybe this fixes the linter error?
* Remove nolint to see if linter fails
* Breaking, removed bridgeName
bridgeName refers to the OVS Switch I believe
* If native uses snat bridge, should also get IP
* Breaking, Decouple or Wrap snat route
* Check to see if snat triggered
* Snat behaviors specific to ovs/native
* Pass the pointer
Add/Delete ok
* Renaming to make consts public
* Breaking, moving ovs specific parts of snat to ovs
* Remove enable infra vnet (Tests ok)
Tested:
Allow Host to NC only
Allow NC to Host only
Allow both
Wget
Ping between containers
Warning: Enable snat is still hard coded to true!!!
* Move add port to after exists() check
* Moved netns interface to caller, generalized tests
Tests ok, Native ok
* Typos
* Reordered if statement, unwrapped arp
Tests ok, ping ok, wget ok
* Linted, wrapping errors
* Go fumpt entire network package
* Code markers removed, clean (Tests ok)
OVS & Native:
- Ping between two containers same VM, no packets on bridge
- Ping between two containers diff VM, no packets on bridge
- Ping other container not in vnet, no packets on bridge
- Ping snat to container, packets on bridge
- Ping container to snat, packets on bridge
- Tcpdump confirmed on azSnatBr
- Deletion of containers deletes appropriate interfaces
* Renamed veth, fixed logs
* Made deleteEndpoints logic clearer, renamed error
* Renamed eth0 to primaryHostIfName, vlanEth to vlanIf
* Deleted debug log
* Corrected merge (hardware addr) (Tests ok)
* Renamed vlan veth to hostExtIf_vlanID, Disabled RA
eth0.2 makes disable RA look for a folder eth0 and then another sub folder "2". ("eth0/2") However, it should look for a folder named "eth0.2" literally. To solve this, we change the naming scheme to use an underscore instead. (Tests ok)
* Renamed Native to TransparentVlan
Confirmed basic functionality on VM with correct mode
* Make file updated
* Create azure-windows-multitenancy-transparent-vlan.conflist
* Unified snat err format
* Rename to transparent-vlan
* Route table support added to local netlink
* Moved SNAT to end of function
* Defer deleting vlan interface on failure
* Remove azure-vne-telemetry for windows multitenancy and telemetry service for windows multitenancy will be started from cns.
* start telemetry service from cns
* lint and log fix
* minor change
* addressed comment
* add windows cns manifest to multi arch image
* try to use generic windows template w/ containerize stage in pipeline
* try and use buildah to pull images
* update manifest build and push for buildah
* create manifest by referencing images instead of pulling to avoid OS mismatch error
* remove unused windows-image.yaml
* remove REGISTRY var and use IMAGE_REGISTRY from makefile
Co-authored-by: Jaeryn <tsun.chu@microsoft.com>
Co-authored-by: Evan Baker <rbtr@users.noreply.github.com>
* [NPM] Adding a SCTP sxclusion increasing tests to 214 in cyclonus
* Adding support for a new extended github workflow nightly
* fix the make command
* fix the make command
* remove dbug flag
* increasinf timeout
* removed test/ and testutil/ from code coverage
* remove promutil from coverage
* removed tools/ from code coverage
* removed crd/ from code coverage and updated multitenantnetworkcontainer's manifest
* switch to !ignore_NAME syntax for test and cli tags
* add coverage back to crd (besides autogenerated files)
* rename ignore_test and ignore_cli tags to ignore_uncovered
* make cns/fakes/ uncovered
* mark go files in crd api folders as uncovered again
* add main.go back for nnsmock server
* inital dump state and ipam interface update
* add reconcile command to CNI
* add integration test
* pass endpoint id on add
* address some feedback
* fix test path and linting
* address feedback and logging
* remove return and rename to PodEndpointID
* Modify CNI for windows baremetal scenario in Azure
* Fix the CNI result for baremetal case
* Addressed PR comments from Tamilmani and Ramiro
* Remove azure-telemetry.exe from cni-baremetal package
* Fix formatting in logging
* Addressed Ramiro's PR review comments
* Formatting fix in printf
Co-authored-by: VK <abc@gmail.com>
* NewRequestController and StartRequestController
* Making Start Manager in go routine
* Lookup HOSTNAME env var
* Adding cnsipaminterface.go
* Created requestController interface and implemented updating CRD
* fix windows 1903 test apimodel.json (#585)
* Avoiding redundant calls into cns by only watching for status updates in reconcile loop, ignoring spec updates in reconcil loop. Also adding ability for updating CRD spec through k8sRequestController methods
* fixing comments
* Cleaned up code and added more comments
* Made client interface for testing purposes and changed structure of files to be less folder-y
* Addressed comments from Paul Miller and Wei
* Beginning unit tests
* Finished unit tests
* Fixing pipeline issues
* found issue, fixed HOSTNAME environment variable dependency
* review changes requested
* more review changes
* Addressed changes from yesterday's review
* Changing makefile line to run correct package
* Addressed Matt Long's suggestions
Co-authored-by: Mathew Merrick <matmerr@users.noreply.github.com>
* About to take debugging comments out
* Removed debugging statements and tested again
* Removed more debugging statements and unused method
* Made changes suggested by Tamilmani, tested again.
* Made spacing changes suggested by Tamilmani
* Triggering new tests to run
* Added AITelemetry support for CNI
* added new files
* added other configs in config file
* fixed ut
* updated disableall similar to cns
* added container name to report
* addressed review comments
* addressed review comments
* added check for azure environment
* added log
* close log handle in unit test
* addressed review comments
* addressed review comments
* fixed a condition
* keep the netagent channel for logs
* fixed error
* addressed review comments
Expose 2 APIs to publish and unpublish network containers from CNS.
a. PublishNetworkContainer
b. UnpublishNetworkContainer
DNC calls CNS to publish and unpublish the network containers.
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.
* added application insights telemetry package to send metrics and logs to appinsights
* moved a function common to both packages
acquired a lock before writing to file
* added read write lock as per chandan comment. Addressed jaeryn comments
* fixed telemetry unit test
* defined interface and added appinsights package as vendor to acn
* added vendor package.go(appinsights)
* dependencies of appinsights
* added AI dependencies
* updated unit tests
* addressed review comments
Loopback adapter creation operation comprises of two operations - createInterface and setWeakHostOnInterface. These operations take place inside the lock. If there are simultaneous requests, it interleaves these calls causing every loopback adapter creation to absorb the delay due to interleaving. createInterface can take time in seconds (typically 2 to 7 seconds based on the tests) while setWeakHostOnInterface finishes very quickly ( less than a second ). This change calls setWeakHostOnInterface within the same lock if createInterface succeeds. The tests show this improves the loopback adapter creation times for simultaneous requests.