414 Commits

Author SHA1 Message Date
Adam Finn Tulinius
11ae253f12 Validate the presence of port definitions before attempting to access (#643)
This fixes #642, which causes kube-router to crash on valid network
policies, and also implements support for ingress and egress rules
without a port specified.
2019-01-21 11:10:57 +05:30
Ivan Kurnosov
10ddc095ff Fixed typo in Global External BGP Peers example (#627)
`peer-router-asns` does not need quotes around
v0.2.4
2019-01-11 13:46:51 +05:30
Matus Kral
d7a7a6d797 Add missing ip6tables package to docker container (#631) 2019-01-11 09:33:54 +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
Arvinderpal Wander
4efc6cceae Add documentation on dependency management using dep. (#621) 2018-12-27 08:09:38 +05:30
bazuchan
34270e426d Periodicaly sync iptables MASQUERADE rules (#619) 2018-12-26 14:51:41 +05:30
Arvinderpal Wander
c63e71a523 Enable net.bridge.bridge-nf-call-ip6tables for IPv6. (#608)
https://github.com/cloudnativelabs/kube-router/issues/607
2018-12-15 18:14:13 +05:30
bazuchan
48e2c7b784 Add iptables input rules for ipvs services (#604) 2018-12-13 16:19:34 +05:30
Eric Lindvall
c38e8f66ff Change append to insert for iptables rules (#596)
* Change append to insert for iptables rules

Updates how iptables FORWARD rules are applied to accommodate an existing final DROP rule for the chain.

* Fix the calls to Insert() to include a position

* iptables rules indexes are 1-based
2018-12-13 12:52:38 +05:30
bazuchan
853b75b156 Periodicaly sync default forward rules (#603) 2018-12-13 12:40:36 +05:30
Lars Ekman
6cdc237377 Make ipv6 routing to pods (CNI routing) work for ipv6 (#578) 2018-12-09 11:45:56 +05:30
Murali Reddy
7b9291aa2d fix docs 2018-12-09 10:58:06 +05:30
Steven Armstrong
1a30f9e2e1 implement per-service annotations to control IP advertisment (#575)
* add unit tests for implementing #75

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

* integration tests for #75

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

* update docs for #75

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

* define new kube-router.io/service.advertise.* annotations

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

* Implement per service annotations for advertising IPs.

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

* more consistent annotation names

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

* remove redundant tests

Signed-off-by: Steven Armstrong <steven.armstrong@id.ethz.ch>
2018-12-09 10:38:12 +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
Aaron U'Ren
0cdaa4362f docs/bgp.md: change example to use printf (#594)
Using echo places a new-line character at the end of the base64
generated string which will cause peering to fail for most use-cases as
it is unlikely to be present in the configuration of the other peer.
2018-12-07 02:04:52 +01:00
Joakim Karlsson
46f8265e1b
docs: how to configure explicit proxy (#582)
from https://github.com/cloudnativelabs/kube-router/issues/494
2018-11-27 09:26:02 +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
v0.2.3
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
rillion
c39c13b6cf No reason to restrict Peer ASN's to private only. (#576)
* No reason to restrict Peer ASN's to private only. This change is to restrict to public and private ranges.

* gofmt
2018-11-16 11:12:31 +05:30
Murali Reddy
4d6b7faaf9
Fixes regression in BGP route reflector functionality. (#573)
Use proper conversion so correct cluster ID is passed to GoBGP library
v0.2.2
2018-11-15 08:45:56 +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
Kurochan
3723d82247 fix typo on docs/bgp.md (#568) 2018-11-05 01:35:10 +01:00
Lars Ekman
535fcc5abe Added "--router-id=" parameter. (#563)
For ipv6 it is not possible to use the ip address as router-id
and this parameter is required.
2018-11-02 11:00:02 +05:30
Don Bowman
2a8203559a Add mount of /lib/modules to kube-router kubeadm setup doc (#565)
The 'kube-proxy --cleanup' checks that ip_vs.ko exists/is loaded.
To do this it ends up looking in /lib/modules/... and generates
an error: `Running modprobe ip_vs failed with message...`.
Add -v /lib/modules:/lib/modules to instructions.

Signed-off-by: Don Bowman <db@donbowman.ca>
2018-11-02 10:57:17 +05:30
Lars Ekman
f95cdedfaa Improved detect in ipv6IsEnabled() (#555)
* Improved detect in ipv6IsEnabled()

* Added comments in ipv6IsEnabled.

Problem described in #155
2018-10-27 09:21:38 +05:30
Murali Reddy
827bbbcd4d
infer endpoint is local from endpoints "subset.addresses.nodeName" (#560)
Fixes #557
2018-10-27 09:19:24 +05:30
Murali Reddy
d9570c5872
all toleration for nodes with taint node.kubernetes.io/not-ready (#558)
Fixes #547
2018-10-25 12:49:37 +05:30
Lars Ekman
bf636c0cb7 Added ipv6 documentation (#551) 2018-10-12 11:13:12 +05:30
Inju Song
0416e07c5c Change IMAGE_TAG -> IMG_TAG in developing guide (#550)
Signed-off-by: Inju Song <inju.song@navercorp.com>
2018-10-10 13:03:32 +05:30
Lars Ekman
077ff86bcc Ipv6; BGP peering (#545)
* Use ip6tables for ipv6 and handle ipv6 for egress rules

* Make the temp ipset's fit into 31 characters

This should be improved. Some hash string should be used for
temp names.
v0.2.1
2018-10-10 11:02:59 +05:30
Jimmy Zhang
a47e0f4541 Add support for 'except' feature of network policy rule (#543)
* add support for 'except' feature in NPC

* support CIDR with zero prefix size in NPC
2018-10-03 12:50:37 +05:30
Lars Ekman
05907d8def Ipv6; Support ipset with "family inet6" (#538)
* Ipv6; Support ipset with "family inet6"

* Removed unnecessary comment
2018-09-23 12:42:52 +05:30
rjosephwright
77459ddb2c Add CLI option to toggle disabling of source-dest-check in EC2 (#541)
When the number of nodes in a cluster is high enough, the
`disableSourceDestinationCheck()` logic creates a high number
of requests to EC2, resulting in throttling and subsequent
problems, such as the inability to attach EBS volumes. This is
not necessarily mitigated by the `ec2IamAuthorized` attribute
which was added to overcome this issue, as the number of
requests can still be high enough to reach Amazon's request
limits. In addition, it is not necessary to run this multiple
times in a loop for all the nodes in a cluster, as it is
sufficient to set it once when an instance boots.

This CLI option allows an administrator to turn off this
feature for kube-router so they can use some other means of
setting the attribute.
2018-09-23 00:20:37 +05:30
Jimmy Zhang
cadba6c863 Use ipset to manage multiple CIDRs in a network policy rule (#529)
* using ipset to manage multiple src CIDRs

* using ipset to manage multiple dst CIDRs

* soft-code the prefix of iptables chain name and ipset name

* gofmt
2018-09-18 18:31:28 +05:30
Andrew Sy Kim
cd4ad6f32e update docker build image to go1.10.3 (#535) 2018-09-12 17:18:39 +05:30
Murali Reddy
c10a61555e
update vendored gobgp to latest release (#533)
Fixes #451
2018-09-11 08:13:54 +05:30
Guirish Salgaonkar
b479f25d5b Added support for ARCH=s390x (#532) 2018-09-10 23:42:19 +05:30
Jimmy Zhang
1b7ae13e2c make the comments of the iptables rules more accurate and reasonable (#527) 2018-09-10 23:36:00 +05:30
Andrew Sy Kim
7496b00ddd dont shutdown gobgp server if graceful restart is enabled (#526) v0.2.0 2018-08-31 16:49:24 +05:30
Joakim Karlsson
02eb11ba09
Sponsorship update (#524)
* update sponsors
2018-08-30 10:15:36 +02:00
Andrew Sy Kim
468f16b5d3 Delete CHANGELOG.md (#520)
We put CHANGELOG info along with the release so this file is no longer needed.
2018-08-22 06:08:46 +05:30
Murali Reddy
01ec8837fa
prevent IPIP tunnel creation when --override-nexthop=ture (#518) v0.2.0-beta.10 2018-08-15 23:03:22 +05:30
Johan Thomsen
1db83adfb9 Added support for custom BGP ports with 179 still being default (#492) (#493)
* Introduced new cmdline flag --bgp-port, which controls BGP Server listening port and remote port of in-cluster node peers

    * Introduced new cmdline flag --peer-router-ports, which controls remote BGP port for external peers

    * Introduced new node annotation kube-router.io/peer.ports with same effect as --peer-router-ports
2018-08-15 22:59:47 +05:30
Murali Reddy
86ba7840a6
Introduces the option --override-nexthop, to override the next hop used in advertised routes (#502)
* Introduces the option --override-nexthop, setting it to true will make
advertised next hop for the routers to the peers will be automatically
selected to be appropriate reachable local IP. This will be overrider
any next-hop set for the routes in the RIB. Kube-router by defauly set
the next-hop to `node IP` which is not correct in case of nodes with
multiple interfaces and use differnt interaces for differect external
peers.

Fixes #480

* add next-hop-self documentation
2018-08-13 20:12:55 +05:30
JuanJo Ciarlante
b76d22f0d8 [jjo] ipAddrDel(): also delete VIP local rt addition (#514) 2018-08-13 18:21:30 +05:30
Murali Reddy
624c74f865
issue-385: make it optional on which ip address BGP server listens (#473)
* introduces per node anntation kube-router.io/bgp-local-addresses to configure IP address on which BGP server should lister

* docs
2018-08-13 17:47:23 +05:30
Andrew Sy Kim
94e163b5d7 update BGP export policies on endpoints add event (#508) 2018-08-10 19:40:37 +05:30
Jimmy Zhang
85d8df425d Improve health check for cache synchronization (#498)
* improve Control flow logic
* drop log,comment,sleep
* update user-guide.md
* set cache-sync-timeout default to 1m
2018-08-10 13:12:11 +02:00
Joe Conti
e2ee6a7659 Fix blackholing of traffic when using local traffic policy / annotation (#495) 2018-07-29 19:53:17 +05:30