Commit f862560
committed
OVN-Kubernetes: Implement per-node feature enforcement via OVN_NODE_MODE
This commit introduces OVN_NODE_MODE environment variable to enable per-node
feature enforcement, particularly for DPU host mode where certain features
must be disabled regardless of cluster-wide configuration.
## Key Changes:
### Configuration Architecture
- Move feature toggles from ConfigMap (004-config.yaml) to startup script (008-script-lib.yaml)
- ConfigMap values cannot be reliably overridden per-node, but script logic can be conditional
- Implement OVN_NODE_MODE-based conditional feature enablement in startup script
### DPU Host Mode Support
- Add 'dpu-host' mode that automatically disables incompatible features:
- Egress IP and related features (egress firewall, egress QoS, egress service)
- Multicast support
- Multi-external gateway support
- Multi-network policies and admin network policies
- Network segmentation features
- Set gateway_interface='derive-from-mgmt-port' for DPU host nodes
- Add ovnkube_node_mode='--ovnkube-node-mode dpu-host' flag
### Removed ConfigMap Entries
From bindata/network/ovn-kubernetes/*/004-config.yaml:
- enable-egress-ip=true
- enable-egress-firewall=true
- enable-egress-qos=true
- enable-egress-service=true
- enable-multicast=true
- enable-multi-external-gateway=true
- enable-multi-network=true (conditionally)
- enable-admin-network-policy=true (conditionally)
- enable-network-segmentation=true (conditionally)
Note: HyperShift hosted cluster ConfigMap (managed/004-config.yaml) retains
egress feature flags as DPU host mode is not supported in hosted cluster
configurations.
### Script Logic Implementation
- Add conditional blocks in 008-script-lib.yaml based on OVN_NODE_MODE
- Full mode (default): All features enabled as configured
- DPU host mode: Incompatible features force-disabled
- Maintain backward compatibility for existing deployments
- Rename egress_ip_enable_flag to egress_features_enable_flag for clarity
### Testing
- Add comprehensive TestOVNKubernetesScriptLibCombined test covering:
- DPU host mode feature gating and disabling
- Full mode with multi-network features enabled/disabled
- Non-mode-gated features (route advertisements, DNS resolver, etc.)
- Gateway interface variable usage validation
- Multi-external gateway and egress features flag behavior across modes
- Remove redundant individual test functions after consolidation
- Update existing config rendering tests for new ConfigMap content
- Update test assertions to use correct flag names (egress_features_enable_flag)
### Documentation
- Create docs/ovn_node_mode.md with detailed technical explanation
- Update docs/operands.md with OVN-Kubernetes node modes section
- Update docs/architecture.md with per-node configuration explanation
- Update README.md with DPU host mode support information
- Add implementation details, feature mapping tables, and migration notes
- Document multi-external gateway as disabled feature in DPU host mode
- Update all references to use correct flag names
## Rationale:
ConfigMap-based feature control cannot be overridden per-node, making it
impossible to disable features on specific node types (like DPU hosts) while
keeping them enabled cluster-wide. Moving the logic to startup scripts allows
the same cluster configuration to work across heterogeneous node types.
This change ensures that DPU host nodes automatically have incompatible
features disabled, preventing runtime failures and enabling mixed-mode
cluster deployments.
## Backward Compatibility:
- Existing clusters continue to work without changes
- Default behavior (full mode) remains unchanged
- Migration is automatic during upgrade process
- No manual intervention required
- HyperShift hosted clusters unaffected (DPU host mode not supported)1 parent 31ac8da commit f862560
File tree
10 files changed
+319
-207
lines changed- bindata/network/ovn-kubernetes
- common
- managed
- self-hosted
- docs
- pkg/network
10 files changed
+319
-207
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
160 | 172 | | |
161 | 173 | | |
162 | 174 | | |
| |||
Lines changed: 38 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
515 | 520 | | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
522 | 544 | | |
523 | 545 | | |
524 | 546 | | |
| |||
564 | 586 | | |
565 | 587 | | |
566 | 588 | | |
567 | | - | |
| 589 | + | |
568 | 590 | | |
569 | 591 | | |
570 | 592 | | |
571 | 593 | | |
572 | | - | |
| 594 | + | |
573 | 595 | | |
574 | 596 | | |
575 | 597 | | |
| |||
590 | 612 | | |
591 | 613 | | |
592 | 614 | | |
593 | | - | |
| 615 | + | |
594 | 616 | | |
595 | 617 | | |
596 | 618 | | |
597 | 619 | | |
598 | | - | |
| 620 | + | |
599 | 621 | | |
600 | 622 | | |
601 | 623 | | |
| |||
656 | 678 | | |
657 | 679 | | |
658 | 680 | | |
659 | | - | |
| 681 | + | |
660 | 682 | | |
661 | 683 | | |
662 | 684 | | |
663 | 685 | | |
664 | 686 | | |
665 | 687 | | |
666 | 688 | | |
667 | | - | |
668 | | - | |
669 | | - | |
| 689 | + | |
670 | 690 | | |
671 | 691 | | |
672 | 692 | | |
| |||
682 | 702 | | |
683 | 703 | | |
684 | 704 | | |
685 | | - | |
| 705 | + | |
686 | 706 | | |
687 | 707 | | |
688 | 708 | | |
| |||
694 | 714 | | |
695 | 715 | | |
696 | 716 | | |
697 | | - | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
698 | 720 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 36 | | |
41 | 37 | | |
42 | 38 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | 39 | | |
47 | 40 | | |
48 | 41 | | |
| |||
52 | 45 | | |
53 | 46 | | |
54 | 47 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | 48 | | |
63 | 49 | | |
64 | 50 | | |
| |||
147 | 133 | | |
148 | 134 | | |
149 | 135 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | 136 | | |
158 | 137 | | |
159 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
| 397 | + | |
| 398 | + | |
397 | 399 | | |
398 | 400 | | |
399 | 401 | | |
| |||
Lines changed: 1 addition & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 39 | + | |
43 | 40 | | |
44 | 41 | | |
45 | 42 | | |
46 | 43 | | |
47 | 44 | | |
48 | 45 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | 46 | | |
53 | 47 | | |
54 | 48 | | |
| |||
61 | 55 | | |
62 | 56 | | |
63 | 57 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | 58 | | |
69 | 59 | | |
70 | 60 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
538 | 538 | | |
539 | 539 | | |
540 | 540 | | |
| 541 | + | |
| 542 | + | |
541 | 543 | | |
542 | 544 | | |
543 | 545 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
144 | 150 | | |
145 | 151 | | |
146 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
96 | 116 | | |
97 | 117 | | |
98 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
0 commit comments