569 Commits

Author SHA1 Message Date
Aaron U'Ren
054d5d1ceb
feat(lint): add basic typos checker to ensure less spelling mistakes in the future 2026-03-15 13:44:32 -05:00
Aaron U'Ren
2cc9b129f2
doc: correct spelling and grammar mistakes 2026-03-15 13:44:32 -05:00
Roman Kuzmitskii
39efb9230c feat: add support for SCTP
includes workaround for musl hardcoded protocol table that
  is missing SCTP support by using protocol name to
  numeric value mapping in ipset entries

closes: https://github.com/cloudnativelabs/kube-router/issues/1019
Signed-off-by: Roman Kuzmitskii <roman@damex.org>
2026-03-09 19:42:08 -10:00
Roman Kuzmitskii
b1a34ed438 feat(gobgp): add kube_router_bgp_peer_info metric
Replace the misleading kube_router_controller_bgp_peers gauge
  which only counts 'cluster nodes' with a new per peer metric
  kube_router_bgp_peer_info with 'GaugeVec' that exposes actual
  BGP session state from gobgp. labels include peer address, asn,
  type, and state. Metric value is 1 if established and 0 otherwise.

Closes: https://github.com/cloudnativelabs/kube-router/issues/848
Signed-off-by: Roman Kuzmitskii <roman@damex.org>
2026-03-07 18:41:29 -10:00
Aaron U'Ren
a8dd0c23c1 fix(aws.go): load region before attempting to assume a role 2026-02-15 12:08:37 -06:00
Aaron U'Ren
ae9c04c4dd feat(gobgp): update v3.37.0 -> v4.2.0 2026-02-13 14:31:16 -08:00
Aaron U'Ren
a1e6de9f8f test(NSC): add endpoint checking to tests that need them 2026-02-01 11:07:13 -06:00
Aaron U'Ren
3157e85eb8 test(NSC): fix two DSR service tests to create pods 2026-02-01 11:07:13 -06:00
Aaron U'Ren
ca6b644d32 test(NSC): mock netlink calls - attempt 1 2026-02-01 11:07:13 -06:00
Aaron U'Ren
b9cd0de978 test(NSC): add DSR unit tests - series 1 2026-02-01 11:07:13 -06:00
Aaron U'Ren
10f366ace6 test(NSC): implement traffic policy unit testing
Logic errors & regressions relating to traffic policies make up
approximately 8 or so preventable historical issues with the project.
Therefore prioritizing them as a unit testing surface.
2026-02-01 11:07:13 -06:00
Aaron U'Ren
048680706c fix(NSC): cleanup historical bad IPv6 TCPMSS vals 2026-02-01 10:56:40 -06:00
Aaron U'Ren
8aaba6505e test(NSC): add comprehensive TCPMSS unit tests 2026-02-01 10:56:40 -06:00
Aaron U'Ren
d208307d43 fact(test): reuse existing ValToPtr functions 2026-01-31 12:15:35 -06:00
Aaron U'Ren
ae39f279a7 fact(NSC): use LinuxNetworkingMock instead of creating a new one 2026-01-31 12:15:35 -06:00
Aaron U'Ren
59814eb67b fix: convert ginkgo tests to standard go tests 2026-01-31 12:15:35 -06:00
Aaron U'Ren
790d53ee51 fact(bgp_peers.go): migrate for loop -> slices.Contains 2026-01-26 10:20:51 -06:00
Aaron U'Ren
827cb4ae7b fix(BGP): always configure AFI SAFI
Changes AFI SAFI configuration to:
* Use consolidated logic for AFI SAFI configuration for both internal
  peers and external peers
* Configure AFI SAFI regardless of GracefulRestart enablement
  * This is important because by default GoBGP only configures a default
    AFI SAFI configuration for the address family of its configured
    peering IP. Which means that previously dual-stack configurations
    that did not enable GracefulRestart would not work (see: #1992)
2026-01-26 10:20:51 -06:00
Richard Kojedzinszky
ee0940b87c fix(dsr): set TCPMSS based on address family 2026-01-25 12:00:21 -06:00
Cat C
4fb0b62658 chore: Use context instead of deprecated golang.org/x/net/context 2026-01-15 08:31:46 +01:00
Cat C
440ad4d0a1 fix: Replace all netlink functions that throw ErrDumpInterrupted with a retry wrapper 2026-01-09 09:17:43 -06:00
Cat C
a8326ca382 fix(nrc): Update make test-pretty to test internal subdirectory. Update nlretry and LocalLinkQuerier interface to support passing in contexts 2025-12-28 16:50:40 -06:00
Cat C
8ea5e44db8 fix(nrc): Add netlink.Handle wrapper to retry netlink calls that raise ErrDumpInterrupted errors 2025-12-28 16:50:40 -06:00
Cat C
ed79de5ccd feat(NRC): Restructures the PeerConfig struct introduced in
the previous commit to make the API easier to understanding and use.
2025-12-15 22:46:22 -06:00
Cat C
9e091b8875 feat(NRC): This commit adds support for a consolidated annotation for configuring
a node's BGP peer settings while maintaining backwards support for the existing
annotations to address #1393.
2025-12-15 22:46:22 -06:00
Aaron U'Ren
5c7215da52 fact(service.go): modernize interface{} -> any 2025-12-02 18:22:37 -06:00
Aaron U'Ren
36b3a3aeaa fix(service.go): rely on LabelServiceName only
When resolving EndpointSlice -> Service ownership, do expose an error if the ownerReference in the metadata does not
agree with the kubernetes.io/service-name label. Instead just use the service-name label.

This aligns better to the way that other network plugins work.
2025-12-02 18:22:37 -06:00
Aaron U'Ren
fcdb0ed8ae fix(node.go): embed root cause errors in returned errors 2025-12-02 18:03:34 -06:00
sunhuanran
052151f285 fix: do not advertise Pod IPv4 CIDR in a Cluster composed of IPv6-only Nodes) 2025-11-22 12:28:12 -06:00
ccoVeille
e06ddccabe feat(test): use safecast.RequireConvert as a replacement for safecast.Convert in tests 2025-11-21 21:20:44 -06:00
ccoVeille
1e8976bd79 build(deps): update github.com/ccoveille/go-safecast to v2.0.0 2025-11-08 01:13:51 +01:00
ccoVeille
e8a59fda2e build(deps): bump github.com/ccoveille/go-safecast to 1.8.1 2025-11-03 12:04:58 +01:00
Aaron U'Ren
846fbd8500 fix(ipset): don't strip inet6 prefixing of ipsets
The problem here stems from the fact that when netpol generates its list of expected ipsets, it includes the inet6:
prefix, however, when the proxy and routing controller sent their list of expected ipsets, they did not do so. This
meant that no matter how we handled it in ipset.go it was wrong for one or the other use-cases.

I decided to standardize on the netpol way of sending the list of expected ipset names so that BuildIPSetRestore() can
function in the same way for all invocations.
2025-10-27 21:25:33 -05:00
Aaron U'Ren
f44598bcb1 test(ipset): add unit tests for ipset regression testing 2025-10-27 21:25:33 -05:00
Bukal, Tomáš
720e2ca2bd fix(ipset): store kube-router-local-ips ipset 2025-10-11 08:26:43 -05:00
Aaron U'Ren
6c44013bc5 fix(ipset): ignore non-kube-router ipsets
Attempt to filter out sets that we are not authoritative for to avoid
race conditions with other operators (like Istio) that might be
attempting to modify ipsets at the same time.
2025-10-04 18:30:28 -05:00
Aaron U'Ren
a4fb70a095 feat(lint): update golangci-lint v2.0.2 -> v2.4.0 2025-09-20 16:30:54 -05:00
Aaron U'Ren
94e72aa8b3 fix(NPC): allow bi-directional ipv6 network discovery
This commit allows ICMP traffic always, not just on the case that
network policy is not applied in a particular direction, as was
originally the intention for KUBE-NWPLCY-DEFAULT.

This commit also consolidates common matching logic for established /
related & invalid traffic flows which hopefully reduces how much
iptables rules we have to make by a significant factor.
2025-09-20 13:58:02 -05:00
Aaron U'Ren
d7214cec4f feat(Endpoints): convert Endpoints -> EndpointSlices 2025-09-06 16:27:03 -05:00
Aaron U'Ren
bb9835ac14 feat(lballoc_test.go): make mock informer satisfy SharedIndexInformer interface 2025-09-06 16:27:03 -05:00
Aaron U'Ren
732d7a72dc fix(nsc): add loadbalancer IPs to metrics 2025-09-01 21:04:49 -05:00
Richard Kojedzinszky
c2fd633373 fix(nsc): sync field name 2025-09-01 21:04:49 -05:00
Richard Kojedzinszky
b4a9ba70fd fix(nsc): rename network_services_metrics.go 2025-09-01 21:04:49 -05:00
Richard Kojedzinszky
7533c183a1 feat(nsc): getMetricsServiceMap() rebuilds only after services changed 2025-09-01 21:04:49 -05:00
Richard Kojedzinszky
5efb999169 feat(nsc): replace unsafe.Pointer with atomic.Pointer 2025-09-01 21:04:49 -05:00
Richard Kojedzinszky
d0163ab725 feat(nsc): move part of Collect() to getMetricsServiceMap() 2025-09-01 21:04:49 -05:00
Richard Kojedzinszky
4e8bb705b5 feat(nsc): move metrics logic to separate file 2025-09-01 21:04:49 -05:00
Richard Kojedzinszky
a224198c89 feat(nsc): optimize key in temporary serviceMap 2025-09-01 21:04:49 -05:00
Richard Kojedzinszky
4ed0cf4117 feat(nsc): improve Service statistics 2025-09-01 21:04:49 -05:00
Richard Kojedzinszky
1b4b6d6b2b feat(nsc): eliminate nested loops in Collect() 2025-09-01 21:04:49 -05:00