72 Commits

Author SHA1 Message Date
Aaron U'Ren
24f87340ff doc(user-guide.md): add info for netfilter tooling
Add warning about userspace netfilter tooling not staying in sync
between daemonset and the host's userspace.
2022-10-20 08:35:40 -05:00
Lucas Mundim
badf8645be feat(bgp): add custom BGP import rejection policy support via node annotation 2022-03-23 09:27:38 -05:00
Aaron U'Ren
4fd7bc4d19 fix(sync_routes): add deletion / immediate syncing
Added the following items to the original logic:
* Added map route entry deletion on withdrawl so that the system doesn't
  incorrectly sync it back to the kernel's routing table
* Added an immediate route sync upon BGP path receive
* Added a mutex to ensure that deleted routes aren't accidentally synced
  back to the system
* Added stopCh and wg (wait group) handling
* Increase default sync time from 15 seconds to 1 minute since this
  scenario is unlikely and netlink calls could potentially be burdensome
  in large clusters.
2022-03-18 15:02:02 -05:00
RusoX89
23ac78cf94 Routes Synchronization Routine 2022-03-18 15:02:02 -05:00
Aaron U'Ren
61ed1849a0 doc(developing): remove broken link 2022-03-10 16:05:51 -06:00
Aaron U'Ren
4832bd13b0 doc: update kube-proxy cleanup commands 2022-03-10 22:50:36 +01:00
Aaron U'Ren
c5af115703 docs: clarify auto-mtu flag purpose 2022-02-11 17:34:10 -06:00
Aaron U'Ren
c3f90c54b3
Fix Misc DSR Issues (#1174)
* fact(NSC): consolidate constants to top

* fix(NSC): increase IPVS add service logging

* fix(NSC): improve logging for FWMark IPVS entries

* fix(NSC): add missing parameter to logging

* feat(NSC): generate unique FW marks

Because we trim the 32-bit FNV-1a hash to 16 bits there is the potential
for FW marks to collide with each other even for unique inputs of IP,
protocol, and port. This reduces that chance up to the 16-bit max by
keeping track of which FW marks we've already allocated and what IP,
protocol, port combo they've been allocated for.

Fixes #1045

* fact(NSC): move utility funcs to utils

* fix(NSC): reduce IPVS service shell outs

This also aligns it more with the almost identical function used for
non-FWmarked services ipvsAddService() which is also called from
setupExternalIPServices and passes in this same list of ipvsServices.

* fix(NSC): fix & consolidate DSR cleanup code

A lot of this is refactor work, but its important to know why the DSR
mangle tables were not being cleaned up in the first place. When we
transitioned to iptables-save to look over the mangle rules, we didn't
realize that iptables-save changes the format of the marks from integer
values (which is what the CLI works with) to hexadecimal.

This made it so that we were never actually matching on a mangle rule,
which left them all behind. When these mangle rules were left, it meant
that IPs that used to be part of a DSR service were essentially
black-holed on the system and were no longer route-able.

Fixes #1167

* doc(dsr): expand DSR documentation

fixes #1055

* ensure active service map is updated for non DSR services

Co-authored-by: Murali Reddy <muralimmreddy@gmail.com>
2021-10-14 16:14:05 +05:30
Aaron U'Ren
85f28411dc feat(.golangci.yml): enable long lines linter and remediate 2021-09-11 16:20:07 -05:00
Aaron U'Ren
14a03a624c fix(bgp.md): misspellings and doc conformance 2021-05-17 12:08:36 -05:00
Aaron U'Ren
9cbc3763b3 feat(bgp): add BGP communities support via node annotation 2021-05-17 12:08:36 -05:00
Aaron U'Ren
b2d8af483f doc(bgp.md): add info about password file configs 2021-05-17 12:08:36 -05:00
Mikhail Sakhnov
0ad00df0ea Mention k0sproject in getting started guide
Signed-off-by: Mikhail Sakhnov <mikhail@skhnv.me>
2021-04-28 16:39:17 -05:00
Aaron U'Ren
70aa0287d6 doc(testing.md): remove vagrant-based testing doc 2021-04-12 11:29:42 -05:00
Aaron U'Ren
d74f5c8ade doc(user-guide.md): clarify externalips hairpin option 2021-04-11 17:31:05 -05:00
Aurélien Dunand
5fc39db6a0 Add hairpin support for externalIps
Add an extra annotation for service in order to generate haipin related
iptables rules for externalsIps of the service.
2021-04-11 17:27:03 -05:00
Manuel Rüger
6bedf27032
Drop vendor, update dependencies, upgrade docker images (#1052)
* Remove vendor directory

* Fix symlink

* Update golang version to 1.15.10

* Update dependencies
2021-04-08 19:33:32 +05:30
yydzhou
49b9add056
Making IPIP/tunnel and override-nexthop independent (#1025)
* enable tunnel plus override-nexthop config

* add docs

* feedback integration

Co-authored-by: deng.zhou <deng.zhou@bytedance.com>
2021-02-09 18:44:56 +05:30
ep4eg
ca2008e576
feat: simple CRI implementation in addition to Docker, required for DSR functionality. CRI compliant runtimes support (e.g. containerd, cri-o, etc.) (#1027)
* feat: simple CRI implementation in addition to Docker, required for DSR functionality. CRI compliant runtimes support (e.g. containerd, cri-o, etc.)

* upd: dependencies

* cleanup

* feat: cleanup gRPC connections after we did the job

* upd: go.sum
2021-02-08 20:04:13 +05:30
Marc Riddle
2ba6f40829
It appears as though this line is no longer relevant (#1029) 2021-02-08 17:41:10 +05:30
George Gaál
2b3f39c25e
Update bgp.md (#1000)
fix the typo
2020-10-29 17:38:40 +05:30
Murali Reddy
92b914e7fd review comments 2020-10-01 23:00:36 -05:00
Murali Reddy
7904b7c950 addressing review comments 2020-10-01 23:00:36 -05:00
Aaron U'Ren
824614d162
Add Support for Reading Peer Passwords via a File (#986)
* Add support for reading peer passwords via a file

Syntax of the file is the same as for --peer-router-passwords, that is,
a comma separated list of base64 encoded passwords.

Passwords specified with --peer-router-passwords have precedence over
passwords read from peer-router-passwords-file.

* fix(options): peer password file linting and doc

Co-authored-by: Jean Raby <jean@raby.sh>
2020-09-08 16:16:21 -05:00
Murali Reddy
3c734fb96a
merge gobgp-update into master (#982)
* merge gobgp-update into master

* update travis.yaml go version:

* go get github.com/osrg/gobgp to build gobgp

* install git as go get needs it
2020-09-07 10:27:58 +05:30
Aaron U'Ren
827ce5510a
Permit ExternalIP on input (#970)
* fact(network_policy): validate ClusterIP CIDR

Ensure that --service-cluster-ip-range is a valid CIDR while controller
is starting up.

* fix(network_policy): parse/validate NodePort

Validate the NodePort range that is passed and allow for it to be
specified with hyphens which is what the previous example used to show
and is more cohesive with the way NodePort ranges are specified when
passed to the kube-apiserver.

* test(network_policy): add tests for input validation

* feat(network_policy): permit ExternalIP on input

fixes #934

* fix(network_policy): ensure pos with index offset

Because iptables list function now appears to be returning -N and -P
items in the chain results, we need to account for them when taking into
consideration the rule position.

* fix(network_policy): add uuid to comments on ensure

iptables list is now no longer keeping the position of parameters which
means that we can't compare string to string. In absence of a better way
to handle this, this adds a UUID to the comment string which can then be
looked for when determining what position a rule occupies.
2020-08-25 21:27:35 +05:30
Aaron U'Ren
5ef989c4f9 fix(options): remove deprecated cluster-cidr option 2020-07-31 10:22:10 -05:00
CloudNativer
1c184624d1
The bgp-holdtime function parameter of setting holdtime is added to adjust the holdtime of BGP negotiation with the connected network devices. (#921)
The bgp-holdtime function parameter of setting holdtime is added to adjust the holdtime of BGP negotiation with the connected network devices.
2020-07-13 09:10:31 -05:00
Aaron U'Ren
b07f53f4b8 fix(graceful_restart): gofmt and doc fixes so unit tests pass 2020-07-10 16:26:54 -05:00
Aaron U'Ren
b7aad2e086
doc(user-guild.md): add info about proxy and SNAT (#935)
fixes #744
2020-06-26 10:57:13 +05:30
Murali Reddy
4d6b0b818f
whitelist traffic to cluster IP and node ports in INPUT chain to bypass netwrok policy enforcement (#914)
* whitelist traffic to cluster IP and node ports in INPUT chain to bypass
netwrok policy enforcement

Fixes #905

* fix unit test failure

* ensure netpol firewall rules are configured after service proxy firewall rules
2020-06-09 16:36:31 +05:30
Murali Reddy
1af329c480
nflog the packet that will be dropped by network policy enforcement (#889)
* nflog the packet that will be dropped by network policy enforcement
that can be further by read by ulogd

Fixes #505

* addressing review comments
2020-05-02 15:45:11 +05:30
Arthur Outhenin-Chalandre
97c682e6f2
Ignore deletion of unknown IPVS rules (#830)
* add a --excluded-cidrs
* ignore deletion of ipvs rules with address in excluded cidrs

Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr>
2020-02-17 01:39:28 +05:30
Murali Reddy
53e0571c8c
fix broken CI (#823)
* fix broken CI

* fix .travis.yml

* skip gomoqs

* fix multi arch image building
2020-01-22 06:38:53 +05:30
Oleg
52e338d859 Add PriorityClass and docs update (#816)
Signed-off-by: Oleg Selin <oleg.selin@renhealth.com>
2019-12-05 23:26:03 +05:30
Aaron Layfield
05d03e7686 #797 Conditionally disable "Allow All" input/chain on IPVS KUBE-ROUTER-SERVICES (#809)
* Added flag and condition for open input on iptables #797

* Adding flag to docs.

* Updated to remove INPUT/CHAIN entirely. Name changed to IpvsDenyAll.

* Updated README.

* Updated docstring on ipvs-deny-all

* ipvsDenyAll -> ipvsPermitAll

* Updating user guide.

* Descriptions updates per review
2019-12-05 16:13:38 +05:30
Andrew Sy Kim
a339d8a5d7
remove stale project sponsorships (#805)
Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2019-10-23 20:04:34 -04:00
Marcus Röder
803bd90256 Allow setting the BGP graceful restart deferral time. See RFC4724 4.1 (#753)
GoBGP's default value for deferral time is 360 seconds.
That means that the routes are not sent to the BGP peer until
this timer is elapsed, so a server is unreachable for 360
seconds, when kube-router restarts.

The new parameter is --bgp-graceful-restart-deferral-time duration_with_unit

For example '--bgp-graceful-restart-deferral-time 10s'
2019-08-22 13:43:13 -07:00
Ivan Kurnosov
4afd6d6d2a Updated the kube-proxy cleanup command to use the newer version (#762)
LGTM. Thanks for the pr @zerkms
2019-07-24 12:05:50 +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
Lucas Servén Marín
e2301761a5 docs,pkgs: change 'can not' to 'cannot' (#701)
This commit fixes a grammar mistake in a doc and some log messages.
2019-04-04 10:27:28 +05:30
Lucas Mundim
8f9729a01d Introduces the option --overlay-type={subnet,full}, to be able to always generate IPIP tunnels regardless of node subnets (#666)
* Introduces the option --full-overlay, to always generate IPIP tunnels regardless of node subnets

* Use --overlay-type={subnet,full} instead of --full-overlay={true,false}
2019-03-23 23:31:42 +05:30
Federico Soave
7b20ae9f58 document workaround for cloudnativelabs/kube-router#676 (#677) 2019-03-10 10:58:58 +05:30
Lucas Mundim
00824cd84b Fix typo (#661) 2019-02-09 10:17:09 +05:30
Ivan Kurnosov
10ddc095ff Fixed typo in Global External BGP Peers example (#627)
`peer-router-asns` does not need quotes around
2019-01-11 13:46:51 +05:30
Arvinderpal Wander
4efc6cceae Add documentation on dependency management using dep. (#621) 2018-12-27 08:09:38 +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