30 Commits

Author SHA1 Message Date
Jérôme Poulin
94fd7b6d74 Send heartbeats during NetworkPolicy and NetworkService sync. (#741)
In reference to issue #725, we modified kube-router to send
heartbeats before starting policy sync to prevent missing
heartbeats while running iptables commands.

Signed-off-by: Jérôme Poulin <jeromepoulin@gmail.com>
2019-06-24 17:03:03 +05:30
Joakim Karlsson
54eedcd049 Issue 572 - Graceful termination + Update to go-1.10.8, alpine-3.9 (#706)
* update netlink

* update libnetwork to get ipvs stats

* update gopkg.lock for libnetwork update

* update libnetwork

* add cli options

* make endpoints delete gracefully

* move conntrack flusher

* get some order in the mainloop

* update to alpine 3.9 & go 1.11.1

* revert to 1.10.3 just update alpine

* and revert travis.yml

* lock version

* test 1.12

* test
2019-04-25 22:57:10 +05:30
bazuchan
70969a3ad7 Add iptables rules for accessing tunneled services from node (#682) 2019-03-10 15:11:51 +05:30
Lucas Mundim
42997cb96c Delete iptables rule if --masquerade-all is false (#665) 2019-03-10 15:07:48 +05:30
Lucas Mundim
00824cd84b Fix typo (#661) 2019-02-09 10:17:09 +05:30
bazuchan
0599a27e9a Add iptables INPUT rules for tunneled services (#610) 2019-01-24 12:57:12 +05:30
Steven Armstrong
4da8ee70f2 [RFC] prevent host services from being accessible through service IPs (#618)
* prevent host services from being accessible through service IPs

- on startup create ipsets and firewall rules
- on sync update ipsets
- on cleanup remove firewall rules and ipsets

Fixes #282.

Signed-off-by: Steven Armstrong <steven.armstrong@id.ethz.ch>

* ensure iptables rules are also available during cleanup

Signed-off-by: Steven Armstrong <steven.armstrong@id.ethz.ch>

* first check if chain exists

Signed-off-by: Steven Armstrong <steven.armstrong@id.ethz.ch>

* err not a new variable

Signed-off-by: Steven Armstrong <steven.armstrong@id.ethz.ch>

* more redeclared vars

Signed-off-by: Steven Armstrong <steven.armstrong@id.ethz.ch>

* maintain a ipset for local addresses and exclude those from our default deny rule

Signed-off-by: Steven Armstrong <steven.armstrong@id.ethz.ch>

* copy/paste errors

Signed-off-by: Steven Armstrong <steven.armstrong@id.ethz.ch>
2019-01-10 23:16:37 +05:30
bazuchan
34270e426d Periodicaly sync iptables MASQUERADE rules (#619) 2018-12-26 14:51:41 +05:30
bazuchan
48e2c7b784 Add iptables input rules for ipvs services (#604) 2018-12-13 16:19:34 +05:30
Joakim Karlsson
e5d599b14c
Roffe/metrics polish (#595)
* update metrics docs & dashboard
* renamed `namespace` label to `svc_namespace` for service metrics as it would be overwritten by most Prometheus setups
* Made histograms for all the controller sync times for better visualization
* added `controller_routes_sync_time`, `controller_bgp_advertisements_sent` & `controller_policy_chains_sync_time` metrics
2018-12-07 16:22:41 +01:00
Joakim Karlsson
5bfab47145
unified function to set sysctl values (#580)
* unified function to set sysctl values and Enable arp_ignore and arp_announce
2018-11-22 21:11:57 +01:00
Joakim Karlsson
4dce4b7c1d
fix typo (#579) 2018-11-19 18:24:19 +01:00
Joakim Karlsson
87718c971d make NSC set net.ipv4.vs.conn_reuse_mode=0 (#577)
* make IPVS proxier set net/ipv4/vs/conn_reuse_mode to 0 by default, which will fix the IPVS low throughput issue

* better error message

* check and inform if to old kernel to use feature
2018-11-19 22:31:24 +05:30
Inju Song
cf9bf47d52 Integrate ip_vs_mh scheduler into kube-router (#564)
* Add to set ip_vs_mh scheduler and flags

Signed-off-by: Inju Song <inju.song@navercorp.com>

* Use scheduler flags when adding or updating service

Signed-off-by: Inju Song <inju.song@navercorp.com>

* Refactor with gofmt, generate moq file and fix test source

Signed-off-by: Inju Song <inju.song@navercorp.com>
2018-11-12 14:13:07 +01:00
Murali Reddy
827bbbcd4d
infer endpoint is local from endpoints "subset.addresses.nodeName" (#560)
Fixes #557
2018-10-27 09:19:24 +05:30
JuanJo Ciarlante
b76d22f0d8 [jjo] ipAddrDel(): also delete VIP local rt addition (#514) 2018-08-13 18:21:30 +05:30
Joe Conti
e2ee6a7659 Fix blackholing of traffic when using local traffic policy / annotation (#495) 2018-07-29 19:53:17 +05:30
Murali Reddy
f340218fba
fix case where 1 min unintended delay is added when checking for tunnel interface to come ip in pod (#472) 2018-07-14 20:15:21 +05:30
Andor Uhlár
7c21815b43 Report delay metrics as seconds, not nanos (#465)
* Report delay metrics as seconds, not nanos
* "ns" -> "s" labels in example dashboard
2018-06-13 16:29:41 +02:00
Murali Reddy
21075348a3
Fixes regression, where adding service VIP to the tunnel interface inside the pods when DSR is used was failing (#462) 2018-06-08 14:09:54 +05:30
Murali Reddy
327a46d5ba
fix race condition issues with health checks (#460)
* fix race condition issues with health checks

* better log meesage when skipping heartbeat
2018-06-07 17:29:19 +05:30
Joakim Karlsson
0809548716 closes https://github.com/cloudnativelabs/kube-router/issues/413 (#457) 2018-06-04 18:52:46 +07:00
Michal Rostecki
d63c23a5f5 proxy: Fix ineffassign error (#447)
`out` variable content after executing `ip route list table` was
never used.
2018-05-24 22:59:45 +05:30
Dan LaMotte
abfb705b62 services: correct check for inactive service endpoints (#430)
* services: correct check for inactive service endpoints

* services: avoid creating ipvs services that would later get deleted
2018-05-17 19:04:35 +05:30
steigr
5421068656 Print output of ip route command as string. (#439)
`Cmd.CombinedOutput()` returns `[]byte` for the command output which, at least for `ip` commands should be a printable string. The output is now printed as string.

Furthermore the constant `KUBE_DUMMY_IF` is used for the interface name to reduce multiple definitions of the interface name.

Signed-off-by: Mathias Kaufmann <me@stei.gr>
2018-05-16 01:53:19 +05:30
Murali Reddy
0538a2a93e
perform clean-up of external ip from custom route table for external ip only if the table is not empty (#437) 2018-05-13 12:38:25 +05:30
Murali Reddy
725bff6b87
use node ip as source when accessing service VIP's from the node (#433) 2018-05-12 09:16:09 +05:30
Dan LaMotte
2f39f9833b cleanup routing table 79 (external IPs) (#431) 2018-05-11 03:19:45 +05:30
Dan LaMotte
dfca917c16 proxy: cleanup stale IPs on kube-dummy-if (#417)
Relates to #411
2018-05-02 01:09:49 +00:00
Murali Reddy
05bec8b385
break controller package to independent packages (#405) 2018-04-22 13:25:58 +00:00