* 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>
* 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>
* 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>
* 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>
* 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.
* 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
* Beginnings of cns yaml
* Beginnings of cns yaml
* Changing to directoryOrCreate and removing addon manager line which was killing pod automatically on aks cluster
* Added else if to catch empty messages
* Stopped sending empty messages to AI telemetry for CNI
* Removing cni prefix from log messages
* Reverting go.sum change back to what it was before
* Adding check for empty messages before sending metric
* Moving empty message check before cnimetric initialization