Граф коммитов

874 Коммитов

Автор SHA1 Сообщение Дата
neaggarwMS 8a32ddc462 Run the complete unit test suite in CNI 2020-07-17 12:26:19 -07:00
neaggarwMS c5095b53c6 Fixed comment 2020-07-17 12:26:19 -07:00
neaggarwMS 8e073e5f94 Enable restserver tests, commented faulty tests for now 2020-07-17 12:26:19 -07:00
neaggarwMS 4a90d00962 Fixed tests 2020-07-16 13:58:25 -07:00
neaggarwMS 3e404bfcff Update SecondaryIpConfigs in NetworkContainerRequest contract 2020-07-16 13:58:25 -07:00
neaggarwMS b4316aa18f Refactored Restserver.go 2020-07-15 20:26:44 -07:00
Paul Johnston 853870c5a5
CNS Client API interface and skeleton implementation (#615)
* Adding api template and skeleton to unblock Neha

* Removed new container type and reversed api order

* Fixed tests and reconcile call
2020-07-15 19:12:03 -07:00
Jaeryn 9d6b6c9194
Fix NATing on *COW (HnsV2) Scenarios (#596)
* For HnsV2 we will only add outbound nat policy for single tenant scenario or if enableSnatForDns is true.

* adding comments to detail results of determineSnat func

Co-authored-by: Jaeryn <tsun.chu@microsoft.com>
2020-07-15 16:14:34 -07:00
Ramiro d623354376
Merge pull request #613 from ramiro-gamarra/fix-go-mod
Updating go mod with Prometheus deps
2020-07-15 15:29:04 -07:00
Mathew Merrick 1d31a7f1ef
Add CNS IPAM check to not overwrite existing state (#614)
* add check to cns to not overwrite state

* use CreateOrUpdateNetworkContainer API instead of directly adding ipconfigs

* rename test for clarity
2020-07-15 15:22:04 -07:00
Ramiro Gamarra cf1a557a80 vendoring dependencies 2020-07-15 13:04:50 -07:00
Ramiro Gamarra 48b9fb8a14 updating go mod and sum 2020-07-15 11:28:31 -07:00
Hunter Gregory 88ea3c2acd
Prometheus metrics (#590)
* prometheus additions to testmain (commented out right now)

* home of the npm prometheus metrics and tools for updating them, testing them

* add/remove policy metrics

* add/remove iptables rule metric measurements

* add/remove ipset metric measurements

* testing for gauges. want to soon remove the boolean for including prometheus in unit testing

* run http server that exposes prometheus from main

* cleaner test additions with less code

* removed incorrect instance of AddSet in the TestDeleteSet test

* added prometheus annotations to pod templates

* deleted unused file

* much more organized initialization of metrics now. now includes map from metric to metric name

* add ability to get summary count value. now getting gauge values and this new count value are done by passing the metric itself as a param instead of a string

* condenses prometheus testing code base by condensing all prometheus error messages into a function

* added testing for summary counts, condensed prometheus error handling code, and updated calls to use new form for getting metric values

* update based on variable spelling change in metrics package

* Added comments for functions and moved http handler code to the http file

* fixed problem of registering same metric name for different metrics, and passing in the wrong param type for testing

* made prometheus testing folder with interactive testing file. moved old random metric flux testing function over from ipsm_test

* moved testing around again

* fixed spelling mistake

* counting mistake in unit test

* handler variable ws in wrong file. Changed stdout printing to logging

* fixed parameter errors and counting error in a test

* moved utilities for testing prometheus metrics to npm/util. Updated StartHTTP to have an additional parameter for waiting after starting the server

* updated uses of StartHTTP to have the extra parameter

* updated GetValue and GetCountValue uses to use the prometheus features of the util package, which is now moved to a promutil package within npm/metrics/

* removed unnecessary comments, removed print statement, and added quantiles to all summary metrics

* fixed problem of double registering metrics

* wait longer for http server to start

* moved tool in test-util.go to promutil/util.go

* fixed timer to be in milliseconds and updated metric descriptions to mention units

* removed unnecessary comments

* http server always started in a go routine now. Added comment justifying the use of an http server

* debugging http connection refused in pipeline

* fixed syntax error

* removed debugging wrapper around http service

* sleep so that the testing metrics endpoint can be pinged

* redesigned GetValue and GetCountValue so that they don't use http calls

* removed random but helpful testing file - will write about quick testing in a wiki page

* milliseconds were being truncated. now they have decimals

* use direct Prometheus metric commands instead of wrapping them

* removed code used when testing was done through http server. Moved registering to metric creation functions

* added createGaugeVec, updated comments, made all help strings constants

* added metric that counts number of entries in each ipset. still need to add tests

* fixed creation of GaugeVecs, and use explicit labeling instead of order-based labeling now

* updated GetVecValue method signature

* added set to metrics on creation and wrote unit tests for CreateSet, AddToSet, DeleteFromSet, DeleteSet

* use custom registry to limit content that Container Insights scrapes. Also log the start of http server

* wrote TODO item comments for Restore and Destroy (currently these functions are only used in testing)

* NPM won't crash if a Prometheus metric fails to register now (unlikely). Added logging for metric registration/creation, and explicit public function to initialize metrics so that we can finish log config first

* initialize metrics in unit tests

* renamed util.go to test-util.go

Co-authored-by: Hunter Gregory <t-hugreg@microsoft.com>
2020-07-14 19:41:02 -04:00
shchen b92d8c6757
Update NPM logs to use Logf instead of Printf. (#610) 2020-07-14 11:11:25 -07:00
Mathew Merrick 644642b100
CNS IPAM for CNI (#584)
* Add IPAM to CNS for CNI
2020-07-13 17:37:49 -07:00
shchen a537df1f45
Add nil pointer checker when reading port value to avoid panic. (#606) 2020-07-10 14:20:36 -07:00
neaggarwMS 508a2bb9c7
Changes for caching pod ip (#600)
* Changes for cahing pod ip

* Test fix for API changes

* added test

* Fixed merge conflicts

* Add tests for pod cache

* Add one more check to validate the cache

* Incorporated the comment

Co-authored-by: neaggarw <neaggarwMS@users.noreply.github.com>
2020-07-10 12:49:18 -07:00
shchen 14e8a980cc
Add logic to hanle different order between namespace selectoer, pod selector, ip block rules. (#604) 2020-07-08 11:08:39 -07:00
shchen d96246eae0
Move ipset deletion condition check from DeleteSet to DeleteFromSet. (#602) 2020-07-08 11:00:36 -07:00
shchen ea5c9a7c21
Add logic to deal with 0.0.0.0/0 which ipset not support. (#599)
* Add logic to deal with 0.0.0.0/0 which ipset not support.

* Add unit test for checking 0.0.0.0/0 ipset entry logic.
2020-07-08 10:00:38 -07:00
neaggarwMS cf25cd318a
Update NPM logs to use Logf instead of Printf (#601) 2020-07-06 10:57:44 -07:00
Paul Johnston a15ff461c6
Request controller for CNS (#583)
* 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>
2020-07-02 11:42:59 -07:00
PrIce Qian 7b5e817bd8
Improving and adding CNI unit tests (#543)
* Add ipam/pool_test.go & add network/*test.go

* add testing ./network/ in Makefile

* fix context
2020-06-26 14:16:45 -07:00
Mathew Merrick 8e4857f2d2
Update Github Templates (#592)
* Simply issue template

* Use issue template builder

* Small improvements

* template revision

Co-authored-by: Qingchuan Hao <qinhao@microsoft.com>
2020-06-26 09:21:49 -07:00
Patrick Lang bb1871a65b
Adding parameter validation to build scripts (#246)
Co-authored-by: Patrick Lang <plang@microsoft.com>
2020-06-25 15:54:40 -07:00
Matthew Long e0cc672ff7
CRD: Move scaling items into scaler, change scope to namespaced (#587)
* Move scaling items into scaler, change scope to namespaced

* added short name nnc
2020-06-24 10:44:59 -07:00
Mathew Merrick 9f82c3f526
Fix NPM image libgnutls vulnerability (#589)
* lock npm image back to ubuntu 18 for libgnutls vulnerability
2020-06-23 20:52:53 -07:00
Jaeryn 942ce4adaa
Updating pipeline image with necessary libs and bumping up base image version to 20.04LTS (#586)
Co-authored-by: Jaeryn <tsun.chu@microsoft.com>
2020-06-23 16:14:27 -07:00
shchen 19fb3e6ed5
Move Cidr translation from iptable to ipset. (#582)
* Move Cidr translation from iptable to ipset.

* Move Cidr translation from iptable to ipset.

* Move Cidr translation from iptable to ipset.
2020-06-22 14:35:29 -07:00
Mathew Merrick 383df33d07
fix windows 1903 test apimodel.json (#585) 2020-06-22 09:42:48 -07:00
shchen 7b3a71fd2a
Update to latest image version for azure-npm.yaml file. (#580) 2020-06-16 14:03:21 -07:00
Jaeryn ab1f6fc75d
Limit and rotate NPM logs (#573) 2020-06-03 13:45:38 -07:00
Jaeryn d3db72e1f7
Re-order NPM IpTable Chains/Rules (#572)
* Move AZURE-NPM chain under KUBE-SERVICES chain; Move default allow CONNECTED/RELATED entry to the end of AZURE-NPM chain.

* Find index of KUBE-SERVICES chain.
2020-06-02 15:45:46 -07:00
Matthew Long 9e154908c2
NetworkConfig CRD defintions (#570)
* NetworkConfig CRD defintions

* v1 to v1alpha, release/request thresholds, naming

* networkconfig to nodnetworkconfig, renaming vars

* subnet to subnetID, added comment for netmask

* removed counts
2020-06-02 15:13:56 -07:00
tamilmani1989 37eed02fd2
Delete cnimultitenancy.md 2020-05-27 00:53:31 -07:00
tamilmani1989 a9c3acddf4
Update cni.md 2020-05-27 00:50:01 -07:00
tamilmani1989 810ebb9eff
updated cni doc 2020-05-27 00:48:42 -07:00
tamilmani1989 ecc23697ad
enable hairpin by default (#568) 2020-05-26 16:45:54 -07:00
tamilmani1989 6515faee86
Disable RA for interfaces created by CNI (#567) 2020-05-26 15:22:10 -07:00
Paul Johnston 11f2d74a7c
Removing execution time metric (#566) 2020-05-20 17:10:49 -07:00
Jaeryn 6542186694
Prevent multiple deletions of pods (#563)
* Prevent multiple deletions of pods

* fix deduct policy test
2020-05-20 10:30:35 -07:00
tamilmani1989 d2ea35d079
fixing race in telemetry test code (#565) 2020-05-19 15:37:38 -07:00
vivekagg-MSFT 4b1ed1e384
Explicitly add content type (#561) 2020-05-17 12:01:20 -07:00
Mathew Merrick 9f3478f828
Add codecov.yml (#559)
* add codecov.yml

* add race flag to tests

* make covermode atomic
2020-05-09 08:19:37 -07:00
tamilmani1989 aed0d716b9
Azure CNI Windows dualstack support (#557)
* windows ipv6 changes

* addressed compilation issues

* return fix

* type error

* updated pipeline.yaml

* removed -mod=vendor

* updated pipeline yaml

* fixed pipeline.yaml

* fixed pipeline.yaml

* updated function name as per comment
2020-05-07 11:40:46 -07:00
Jaeryn 933e5be2cd
Ignore namespace and pod updates that we have not action items on. (#556) 2020-05-05 16:48:23 -07:00
Jaeryn 6712d8b9b6
Making a fix to prevent NPM from deleting ipsets on delete network policies. (#555) 2020-05-05 11:39:17 -07:00
Jaeryn 5e26843be6
Named Ports Support (#553)
* Initial changes to support named ports.

* add support for named ports via ipset ip+port hash

* fixing a couple of operational bugs

* adding simple test to validate named port parsing
2020-05-01 11:42:05 -07:00
Paul Johnston d5c33868ca
Cns yaml (#549)
* Beginnings of cns yaml

* Beginnings of cns yaml

* Changing to directoryOrCreate and removing addon manager line which was killing pod automatically on aks cluster
2020-04-30 15:25:49 -07:00
Mathew Merrick 26569aa10d
Update NPM base image to 20.04 (#552) 2020-04-30 11:27:44 -07:00