114 Commits

Author SHA1 Message Date
kevin.xu
f68372e175 Update network_policy_controller.go (#315)
* Update network_policy_controller.go

typo

* Update network_policy_controller.go

typos
2018-02-20 17:19:13 +05:30
Joakim Karlsson
a466ace4bc Nsc conntrack fix (#305)
* added conntrack exit handling logic

* fixed regex

* regex fix again
2018-02-13 16:05:52 +05:30
Murali Reddy
e25c174182
support service.spec externalTrafficPolicy=Local. Takes precedence over kube-router.io/service.local annotation. (#303)
Also dynamically cleanup service endpoints based on the service spec is set for Local only services or not.
2018-02-13 15:04:51 +05:30
Sergey Lanzman
617c773655 code cleanup (#301) 2018-02-08 00:51:15 +01:00
Joakim Karlsson
b1f3404960 fixed bool values for if http health is enabled 2018-02-06 23:06:36 +01:00
Joakim Karlsson
deba3fa2fe mutex on stats 2018-02-06 11:15:09 +01:00
Joakim Karlsson
f2da44590f added startup delay before healthchecks starts 2018-02-05 10:59:49 +01:00
Joakim Karlsson
cf7c66ee7a Adde flag so health controller knows if HTTP is requested or not 2018-02-05 10:07:34 +01:00
Joakim Karlsson
7066d4dd9e change so no http listener starts if port is not in valid range 2018-02-05 09:42:26 +01:00
Joakim Karlsson
e53aef280c more work on healthchecks 2018-02-04 21:25:49 +01:00
Joakim Karlsson
77cb340cfd missing bracket 2018-02-03 22:53:20 +01:00
Joakim Karlsson
4f8f83d6eb metrics controller ticker 2018-02-03 22:49:57 +01:00
Joakim Karlsson
12aec99844 added heartbeats 2018-02-03 22:43:34 +01:00
Joakim Karlsson
3eb5461fe4 adding output messages 2018-02-03 16:30:11 +01:00
Joakim Karlsson
e6b01d5483 added health controller 2018-02-03 15:01:15 +01:00
Murali Reddy
193776c568
prevent calling gobgp AddNeighbour call before GoBGP server is properly started (#296) 2018-02-01 01:56:40 +01:00
Joakim Karlsson
f3e7aced1a Metrics + Logging update (#294)
* - added protocol & port label to metrics
- removed some redundant code

* added example dashboard

* added dashboard screenshot

* updated dashboard json & screenshot

* ammend bad dashboard export

* first new metric

* .

* more metrics: controller_publish_metrics_time & controller_iptables_sync_time

* namespace redeclared

* fix typo in name

* smal fixes

* new metric controller_bgp_peers & controller_bgp_internal_peers_sync_time

* typo fix

* new metric controller_ipvs_service_sync_time

* fix

* register metric

* fix

* fix

* added more metrics

* service controller log levels

* fix

* fix

* added metrics controller

* fixes

* fix

* fix

* fixed more log levels

* server and graceful shutdown

* fix

* fix

* fix

* code cleanup

* docs

* move metrics exporting to controller

* fix

* fix

* fixes

* fix

* fix missing

* fix

* fix

* test

* test

* fix

* fix

* fix

* updated dashboard

* updates to metric controller

* fixed order in newmetricscontroller

* err declared and not used

* updated dashboard

* updated dashboard screenshot

* removed --metrics & changed --metrics-port to enable / disable metrics

* https://github.com/cloudnativelabs/kube-router/issues/271

* cannot use config.MetricsPort (type uint16) as type int in assignment

* cannot use mc.MetricsPort (type uint16) as type int in argument to strconv.Itoa

* updated docs

* changed default metric port to 0, disabled

* added missing newline to .dockerignore

* add lag parse to pickup on -v directives

* test

* test

* test

* fix regression

* syntax error: non-declaration statement outside function body

* fix

* changed nsc to mc

* updated docs

* markdown fix

* moved metrics registration out to respective controller so only metrics for running parts will be exposed

* removed junk that came from visual studio code

* fixed some typos

* Moved the metrics back into each controller and added expose behaviour so only the running components metrics would be published

* removed to much, added back instanciation of metricscontroller

* fixed some invalid  variable names

* fixed last typos on config name

* fixed order in newnetworkservicecontroller

* updated metrics docs & removed the metrics sync period as it will obey the controllers sync period

* forgott to save options.go

* cleanup

* Updated metric name & docs

* updated metrics.md

* fixed a high cpu usage bug in the metrics_controller's wait loop
2018-01-25 22:56:51 +05:30
Joakim Karlsson
60f67d893f Metrics updates (#292)
* - added protocol & port label to metrics
- removed some redundant code

* added example dashboard

* added dashboard screenshot

* updated dashboard json & screenshot

* ammend bad dashboard export
2018-01-20 10:44:01 +05:30
Joakim Karlsson
edda2b14af Added more metrics and small bugfix + more docs (#291)
* fixed pps out using the wrong metrics

* adding debug

* name fixes
adding more metrics

* missing mustregister

* missing bracer

* added more metrics docs

* fixed faulty names

* fixed more faulty names
2018-01-18 23:05:33 +05:30
Joakim Karlsson
c8c19e4a31 Added cli config for changing prometheus port & path (#288)
* added prometheus metrics port option

* fix propper config

* added option to change path

* added path config to prometheus

* updated readme

* fixed string that should be int
2018-01-17 18:17:43 +05:30
GuoyouZhang
e51dfbff2f support node local service without SNAT, so the pod can see client origin IP if the request from external IP (#277) 2018-01-12 01:15:57 +05:30
Andrew Sy Kim
78588fc3a3 tunnel interface names cannot be longer than 15 characters (#274) 2018-01-07 18:23:13 +05:30
Andrew Sy Kim
c07df49f63 unit tests for syncInternalPeers() (#268) 2018-01-03 23:41:06 +05:30
Andrew Sy Kim
50dcc32dd8 Unit Tests for Node Update Events (#265)
* activeNodes should not be a global variable for better testability

* OnNodeUpdate unit tests
2018-01-03 11:54:29 +05:30
Andrew Sy Kim
4eca430b63 route controller unit tests (#264) 2017-12-29 08:55:22 +05:30
Murali Reddy
f822109907
Prevent slice representing ipset growing forver resulting in excessive memory usage (#260)
Use refresh instead which internally used ipset swap

Fixes #228
2017-12-25 19:37:02 +05:30
Murali Reddy
94a2ec7e17
Flush conntrack entry when UDP service endpoint is deleted (#259)
Fixes #157

kubernetes/kubernetes#19029
kubernetes/kubernetes#22573
2017-12-25 02:08:04 +05:30
Murali Reddy
8ce5e4fe3d
Fix potential issues in DSR due to Golang limitations in switching network namespaces and add verbose logging (#258)
Fixes #248

https://www.weave.works/blog/linux-namespaces-and-go-don-t-mix
docker/libnetwork#1113
https://groups.google.com/forum/#!topic/golang-dev/6G4rq0DCKfo/discussion
2017-12-24 22:28:36 +05:30
Murali Reddy
76ea8c01a2
fix TCP vs 6 string comparision in publishMetrics (#257) 2017-12-24 15:08:44 +05:30
Murali Reddy
22f05e99fd
service prometheus metrics (#255) 2017-12-24 11:32:42 +05:30
Murali Reddy
d13339c6fa
IPVS sync services performnce improvement (#253)
During periodic sync of IPVS services there is a check if the required service
already existing in IPVS. For the check the list of currnet IPVS services are
read from IPVS. This is causing performance hit as number of services increases.

With this fix, Kube-router reads once from ipvs and use for further during service sync
2017-12-19 17:24:18 +05:30
Murali Reddy
c4830aa4e0
enable Pprof with option --enable-pprof (#245)
* rename to connectExternalBGPPeers

* enable pprof for debug purpose
2017-12-12 12:06:38 +05:30
Colin J. Brigato
fcd1a1aab6 Enable support for eBGP Multihop for external peers (#244) 2017-12-12 08:52:55 +05:30
David Robinson
5323b4b8a9 Fix --hairpin-mode=true (#243)
The option was not plumbed through to the controller.
2017-12-11 17:52:34 -06:00
Andrew Sy Kim
2685367ab6 add --enable-ibgp flag (#227) 2017-11-27 21:53:44 +05:30
Andrew Sy Kim
bca422105b --bgp-graceful-restart flag should apply for global peers (#226) 2017-11-23 02:31:57 +05:30
Murali Reddy
7c9db2c721 sync with iBGP peers only after RIB is polulated first 2017-11-23 01:45:15 +05:30
Andrew Sy Kim
0dabd7cf11 Support BGP Graceful Restart (#220) 2017-11-23 01:12:36 +05:30
Murali Reddy
97fb3423f7
explicilty create kube-bridge interface. Earlier when pod is launched on the node (#225)
bridge CNI plug-in was setting up. Which leads to errors when no pod is launched on a node.

Fixes #223
2017-11-21 18:54:07 +05:30
Daniel Beal
75bdfa2a10 Fix --nodeport-bind-all-ip option so that it works (#217)
Works by configuring a IPVS service for all interface IPs found on the
system.

NOTE: Does not support IPv6 because I have not tested
2017-11-09 00:33:07 +05:30
Murali Reddy
28c5dd20ef
use table id instead of table name for custom routing tables (#215) 2017-11-08 07:35:47 +05:30
Murali Reddy
b180094836 set priority for custom routing tables so that, FWMARK packets are delivered locally
and for the rest of the traffic policy routing sets endpoints (dev kube-bridge) as
next hop for external IP's
2017-10-30 17:19:20 +05:30
Murali Reddy
5f425ebb89
Fixes direct server return on exteranl IP's (#210)
- add a route to exteranl ip in custom routing table to prevent martian packets
- switch between Masqurade and Tunnel for forwarding when DSR in disabled and enabled
2017-10-30 11:37:39 +05:30
Murali Reddy
6a3fadae05 Direct Server Return Fixes (#209)
as you annotate and remove DSR annotation, switch the IPVS server
type to tunneling to masqurade mode

also restrict preparing the pod for DSR only to the local pods
2017-10-27 13:40:44 +05:30
Murali Reddy
77f45e356b Use service annotations to choose IPVS scheduling method (#207)
Fixes #6
2017-10-25 11:38:50 +05:30
Murali Reddy
6d432681de support for direct server return (#204)
new annotation is added `kube-router.io/service.dsr=tunnel` to enable DSR

Fixes #40
2017-10-24 18:20:58 +05:30
Murali Reddy
4ca0afa82c Support for advertising service external IP to be configured BGP peers (#203)
introduces new flag `--advertise-external-ip`

Fixes #161
2017-10-17 00:54:19 +05:30
Murali Reddy
ba7697b72e Support for Services with externalIPs (#201)
Fixes #26
2017-10-16 22:45:06 +05:30
Murali Reddy
84741b6a5e network policy: use 'addrtype' module and --src-type=LOCAL to match local traffic 2017-10-16 02:14:44 +05:30
Murali Reddy
665e6676b2 Fix to avoid re-adding existing BGP export policy, and policy assignment (#200)
Fixes #197
2017-10-16 00:50:41 +05:30