Repository navigation
[17.0-stable] zedrouter: ignore portmaps on Switch NIs in the overlap check - #6797
Conversation
|
Converted to draft while #6796 is not merged. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 17.0-stable #6797 +/- ##
===============================================
+ Coverage 22.66% 23.09% +0.43%
===============================================
Files 512 522 +10
Lines 94634 96341 +1707
===============================================
+ Hits 21449 22253 +804
- Misses 71358 72072 +714
- Partials 1827 2016 +189 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
validateAppNetworkConfig() rejects an app whose portmap ACLs overlap with those of another activated app on the same network instance (or on one sharing its port label). Portmaps are only implemented for Local NIs, where they become DNAT rules on the uplink address. A Switch NI does no NAT: every app interface has its own address on the external network and nireconciler never installs portmap rules for it, so two apps using the same lport there cannot conflict. The false positive is harmless on a single node, where the controller lets the user deploy both apps anyway and only the second one fails. On an eve-k cluster it breaks failover. Two VM apps with the same portmap on a Switch NI run fine on different nodes, but when one of them fails over to the node running the other, zedrouter rejects its AppNetworkConfig in handleAppNetworkCreate() before allocating the app number, choosing the MAC generator or activating the network. The adapters are left without a MAC, so every multus ConnectPodAtL2 call for the new virt-launcher pod fails with "failed to find adapter with MAC ...", and the VM never starts on the failover node. Skip adapters on Switch NIs in checkForPortMapOverlap(), both for duplicates within an adapter and across apps. An NI whose config is not known is still checked, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br> (cherry picked from commit 6a6a98a)
9754342 to
d874f87
Compare
d874f87 to
7f8c46b
Compare
| LeaseDuration: 300 * time.Second, | ||
| RenewDeadline: 180 * time.Second, | ||
| RetryPeriod: 15 * time.Second, | ||
| LeaseDuration: 60 * time.Second, |
There was a problem hiding this comment.
I don't know if it is a good idea to use different intervals for this stats leader election between master (18.0) and 17.0
And after all, @andrewd-zededa is about to backport the backup-DNID work, so then you could do a clean cherry-pick.
Maybe it is better to backport the zedrouter patches for now only.
There was a problem hiding this comment.
Agreed. Diverging the stats lease timings from master only to undo them when the backup-DNID series lands isn't worth it. I've reduced this PR to the zedrouter commit (EV-2926). I'll backport the two zedkube commits (gate the VMIRS replica reset on the eve-app-op lease + start a failover only when a pod is terminating) as clean cherry-picks once @andrewd-zededa's backup-DNID backport is merged.
7f8c46b to
a67e4e6
Compare
Description
Backport of #6796 (zedrouter commit only)
Jira: EV-2926
Clean
cherry-pick -xof the master commit:The two zedkube commits of #6796 ("gate the VMIRS replica reset on the
eve-app-op lease" and "start a failover only when a pod is terminating",
EV-2923) depend on the backup-DNID series (#6505), which is not on
17.0-stable yet. They will be backported as clean cherry-picks once that
series is backported.
How to test and validate this PR
On a 3-node eve-k cluster:
portmap ACL (e.g. tcp lport 7022 -> 22), on two different nodes (A and B).
kubectl -n eve-kube-app get vmi,pods -o widefrom a surviving node.Expected: if the app lands on node B, its network is activated and the VMI
reaches Running. There is no
overlapping portmapserror in/run/zedrouter/AppNetworkStatus/<app-uuid>.jsonand nofailed to find adapter with MACerrors.Unit tests:
TestPortMapOverlapIgnoredOnSwitchNI(zedrouter).Changelog notes
portmaps" error when another app on it uses the same portmap. This blocked VM
failover onto a node already running such an app.
Checklist
check them.
Not yet tested on a device.
🤖 Generated with Claude Code