833 Commits

Author SHA1 Message Date
Marcel Fest
be536eaaf7 fix: wireguard + routing-protocol sync (#1769)
* fix(kubevip): reject out-of-range routing protocol values

Netlink carries the address and route protocol in a single byte, so a
configured value above 255 was silently truncated on the wire and never
matched again on readback. Reject it during config validation instead.

Signed-off-by: Marcel Fest <marcel.fest@telekom.de>

* feat(wireguard): qualify service tunnel IDs by protocol

Sanitisation maps '-' onto the '_' separator, so "a-b/c" and "a/b-c"
shared one nftables chain, and TCP and UDP on the same port collided.
ServicePortIDs appends the protocol and, when sanitisation changed the
name or the ID grew too long, a hash of the raw name. It also returns
the previous port-only ID so existing chains can be migrated.

Signed-off-by: Marcel Fest <marcel.fest@telekom.de>

* fix(arp): guard manager state behind a single mutex

Instances were kept in a sync.Map with a per-instance mutex for the
refcount, so lookup and refcount update were not atomic: concurrent
Insert and Remove could resurrect a deleted instance or drop a live one.
Hold one manager mutex across both, and buffer link subscriptions so a
netlink sender is never parked on an unread channel during shutdown.

Signed-off-by: Marcel Fest <marcel.fest@telekom.de>

* fix(instance): roll back partially created instances

Instance creation added addresses, VLAN or macvlan links and DHCP
clients incrementally, so a failure part way through left the node
holding state nobody owned. Initialization now unwinds what it created,
and link cleanup only deletes attachments this instance created that no
remaining instance still uses.

Namespace-dependent tests now skip unless KUBE_VIP_REQUIRE_NETNS is set,
which CI sets on the privileged job so lost capabilities turn it red
instead of silently skipping.

Signed-off-by: Marcel Fest <marcel.fest@telekom.de>

* test(e2e): give docker kill more time under parallel load

The ARP suite runs four kind clusters against one Docker daemon, so
acknowledging a leader kill regularly exceeded the 5s budget and failed
the IPv6 failover specs before any assertion ran.

Signed-off-by: Marcel Fest <marcel.fest@telekom.de>

* fix: regression on preserveOnLeadershipLoss

Signed-off-by: Marcel Fest <marcel.fest@telekom.de>

* fix: use the introduced wireguard service_id

Signed-off-by: Marcel Fest <marcel.fest@telekom.de>

* fix(services): reuse link attachment ownership on service delete

deleteService removed VLAN and macvlan links unconditionally, which tore
down interfaces kube-vip had only adopted and interfaces another Service
still used. Route the delete path through CleanupLinkAttachments and pass
the remaining instances so ownership is handed over instead.

Signed-off-by: Marcel Fest <marcel.fest@telekom.de>

---------

Signed-off-by: Marcel Fest <marcel.fest@telekom.de>
2026-09-18 14:50:37 +02:00
Marcel Fest
f0cbb81d93 fix(vip): synchronize shared datapath state (#1768)
* fix(vip): synchronize shared datapath state

Serialize the interface link cache, route tracker and address configuration so
concurrent Services cannot corrupt shared state or deadlock on nested address
locks.

Signed-off-by: Marcel Fest <marcel.fest@telekom.de>

* fix: dhcp panic and leak potential

Signed-off-by: Marcel Fest <marcel.fest@telekom.de>

---------

Signed-off-by: Marcel Fest <marcel.fest@telekom.de>
2026-09-18 14:29:51 +02:00
Marcel Fest
3d73039cce feat(lease): record VIP ownership in lease annotations (#1767)
* feat(lease): record VIP ownership in lease annotations

Encode the instance name, address protocol and an ordered VIP list on the
Kubernetes lease so a restarting instance can tell which tagged addresses it
still owns. Only the current holder publishes the annotation.

Signed-off-by: Marcel Fest <marcel.fest@telekom.de>
Signed-off-by: Cellebyte <marcel.fest@live.de>
Signed-off-by: Marcel Fest <marcel.fest@telekom.de>

* fix: flip flop on ordering when reading and writing the annotation

Signed-off-by: Marcel Fest <marcel.fest@telekom.de>

* fix: address feedback from review

Signed-off-by: Marcel Fest <marcel.fest@telekom.de>

---------

Signed-off-by: Marcel Fest <marcel.fest@telekom.de>
Signed-off-by: Cellebyte <marcel.fest@live.de>
2026-09-18 14:20:19 +02:00
Patryk Strusiewicz-Surmacki
a60f80b1b2 Refactored and fixed metrics code
Signed-off-by: Patryk Strusiewicz-Surmacki <patryk-pawel.strusiewicz-surmacki@external.telekom.de>
2026-09-16 18:01:07 +02:00
Cellebyte
61a52e8f2a fix: function calls
Signed-off-by: Cellebyte <marcel.fest@live.de>
2026-09-13 22:02:01 +02:00
Cellebyte
7e2dd0d262 fix: add manager interface at the right place
Signed-off-by: Cellebyte <marcel.fest@live.de>
2026-09-13 22:02:01 +02:00
Cellebyte
7a085cb3ce fix(bgp-cp): mem-leak on stacking defers and never exit
Signed-off-by: Cellebyte <marcel.fest@live.de>
2026-09-13 22:02:01 +02:00
Marcel Fest
1f5c135fd1 use ipv6 in error message 2026-09-13 22:01:14 +02:00
Patryk Strusiewicz-Surmacki
b4771c5319 Fixed DHCP concurrency exit issues
Signed-off-by: Patryk Strusiewicz-Surmacki <patryk.pawel.strusiewicz-surmacki@external.telekom.de>
2026-09-13 22:01:14 +02:00
Marcel Fest
618904dea3 fix(ci): deflake debouncer cancellation test and patch CVE-2026-56854
Signed-off-by: Marcel Fest <marcel.fest@telekom.de>
2026-09-04 13:53:04 +02:00
Maximilian Rink
b116d5a469 chore(iptables): remove unused ListByID, Stats, StructuredStats, ParseStat (#1728)
* test(endpoints): follow WireGuard clear refactor

Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>

* chore(iptables): remove unused ListByID, Stats, StructuredStats, ParseStat

Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>

---------

Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-09-04 09:10:19 +02:00
Daniel Finneran
6cbf5aaeda Merge pull request #1723 from MaxRink/fix/fix-dhcp-robustness
fix(vip): harden DHCP client lifecycle and reply parsing
2026-09-03 15:22:21 +01:00
Daniel Finneran
dc453f07fc Merge pull request #1720 from MaxRink/fix/fix-dad-skip
fix(vip): apply per-call DAD skip instead of leaking it into persistent state
2026-09-03 15:21:04 +01:00
Daniel Finneran
14b2f51aba Merge pull request #1718 from MaxRink/fix/fix-svcctx-races
fix(servicecontext): synchronize access to shared context fields
2026-09-03 15:20:14 +01:00
Daniel Finneran
01e8fbc3e3 Merge pull request #1716 from MaxRink/fix/fix-debouncer-deadlock
fix(debouncer): prevent deadlock when forwarding to a terminating object
2026-09-03 15:18:39 +01:00
Daniel Finneran
4504649c91 Merge pull request #1710 from MaxRink/fix/fix-cluster-stop
fix(cluster): make Cluster.Stop concurrency-safe and lock Processor.Stop
2026-09-03 15:17:13 +01:00
Daniel Finneran
47f4e75183 Merge pull request #1709 from MaxRink/fix/fix-route-tracker
fix(route): insert route tracker entry only after AddRoute succeeds
2026-09-03 15:16:16 +01:00
Daniel Finneran
f589a18bd9 Merge pull request #1713 from MaxRink/fix/fix-mpbgp-family
fix(bgp): validate MP-BGP fixed-address family
2026-09-02 17:28:58 +01:00
Daniel Finneran
d79f3ddb52 Merge pull request #1714 from MaxRink/fix/fix-endpoints-locality
fix(endpoints): only use Hostname for locality when NodeName is absent
2026-09-02 17:27:19 +01:00
Daniel Finneran
1b25ce7d0e Merge pull request #1712 from MaxRink/fix/fix-annotations-nodelist
fix(manager): handle empty node list in annotations watcher
2026-09-02 17:26:22 +01:00
Daniel Finneran
96c4406d63 Merge pull request #1711 from MaxRink/fix/fix-bgp-peers
fix(bgp): honour configured peer port and keep source interface on MP-BGP fallback
2026-09-02 17:25:43 +01:00
Daniel Finneran
47b546073a Merge pull request #1703 from MaxRink/fix/makefile-go-version
fix: align GO_VERSION with go.mod toolchain requirement
2026-09-01 10:56:39 +03:00
Justin Cichra
2b126dceed Fix bgp_attach_ip_to_interface not applied to Service VIPs (#1744)
shouldAddServiceIP() checks BGPAttachIPToInterface on a per-service
config struct. NewInstance() builds that struct fresh for each Service,
copying over most fields from the global config, missing this one. As
a result the flag has no effect regardless of its value, and BGP-mode
Service VIPs are never bound to the interface.

Copy the field at both construction sites where it's built, and add
a regression test covering the propagation.

Signed-off-by: Justin Cichra <jrcichra@yahoo.com>
2026-08-31 00:20:08 +02:00
Maximilian Rink
487859e76f test(endpoints): follow WireGuard clear refactor
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-30 23:21:17 +02:00
Maximilian Rink
77fa726c99 test(bgp): cover peer transport options generically
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-30 23:21:12 +02:00
Maximilian Rink
920a0182cb fix(bgp): honour configured peer port and keep source interface on MP-BGP fallback
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-30 23:21:11 +02:00
Maximilian Rink
8d043de910 test(endpoints): follow WireGuard clear refactor
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-30 23:21:11 +02:00
Maximilian Rink
b0b12cfc13 test(vip): fix errcheck lint in DHCPv4 backoff test
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-30 23:21:01 +02:00
Maximilian Rink
b034c81bef fix(vip): harden DHCP client lifecycle and reply parsing
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-30 23:21:00 +02:00
Maximilian Rink
ca9640227a test(endpoints): follow WireGuard clear refactor
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-30 23:21:00 +02:00
Maximilian Rink
a8293f66e4 fix(route): insert route tracker entry only after AddRoute succeeds
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-28 03:03:04 +02:00
Maximilian Rink
9d72f43f62 test(endpoints): follow WireGuard clear refactor
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-28 03:03:02 +02:00
Maximilian Rink
3c3096d89d fix(bgp): validate MP-BGP fixed-address family
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-28 03:01:29 +02:00
Maximilian Rink
5d5c893501 test(endpoints): follow WireGuard clear refactor
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-28 03:01:28 +02:00
Maximilian Rink
d417a0c8e8 fix(manager): handle empty node list in annotations watcher
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-28 00:08:11 +02:00
Maximilian Rink
825ffdb20c test(endpoints): follow WireGuard clear refactor
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-28 00:08:09 +02:00
Maximilian Rink
fe3a379f2d fix(debouncer): prevent deadlock when forwarding to a terminating object
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-28 00:06:38 +02:00
Maximilian Rink
c42a207c26 test(endpoints): follow WireGuard clear refactor
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-28 00:06:36 +02:00
Maximilian Rink
d6e5753464 fix(vip): apply per-call DAD skip instead of leaking it into persistent state
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-28 00:05:25 +02:00
Maximilian Rink
5131b92810 test(endpoints): follow WireGuard clear refactor
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-28 00:05:23 +02:00
Maximilian Rink
e1fd9ac3e3 fix(cluster): make Cluster.Stop concurrency-safe and lock Processor.Stop
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-28 00:02:16 +02:00
Maximilian Rink
1831a05525 test(endpoints): follow WireGuard clear refactor
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-28 00:02:14 +02:00
Maximilian Rink
19198d47fa test(endpoints): cover provider locality parity
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-28 00:00:53 +02:00
Maximilian Rink
1af388ff9f fix(endpoints): only use Hostname for locality when NodeName is absent
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-28 00:00:52 +02:00
Maximilian Rink
d1ff5f2952 test(endpoints): follow WireGuard clear refactor
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-28 00:00:50 +02:00
Maximilian Rink
54881a117c fix(endpoints): preserve nil context guard
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-27 23:59:48 +02:00
Maximilian Rink
426a409a5d fix(servicecontext): synchronize access to shared context fields
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-27 23:59:46 +02:00
Maximilian Rink
5871bec56c test(endpoints): follow WireGuard clear refactor
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
2026-08-27 23:59:45 +02:00
Marcel Fest
a15745c442 fix: pr introduced order regression 2026-08-25 13:15:21 +02:00
Marcel Fest
b684eed5a4 fix(egress): prevent stale active-endpoint overwrite (#1701)
Make the endpoint watcher the sole active-endpoint annotation writer so a Service snapshot captured during startup cannot replace a newer endpoint. Preserve intentionally empty snapshots across endpoint-to-zero-to-same transitions, select the cleared annotation from the configured egress family, reject malformed or wrong-family endpoints, and preserve the other family in dual-stack state.

Fixes #1673.

Signed-off-by: Marcel Fest <marcel.fest@telekom.de>
2026-08-24 18:55:11 +02:00