@@ -30,6 +30,8 @@ const (
3030 DenySecondaryACL = "DenySecondary"
3131 // OpenPortACLPrefix is used to build per-pod ACLs, pod name should be added to the prefix to build a unique name
3232 OpenPortACLPrefix = "OpenPort-"
33+ // the same tier is used for all UDN isolation ACLs
34+ isolationTier = types .PrimaryACLTier
3335)
3436
3537// setupUDNACLs should be called after the node's management port was configured
@@ -63,7 +65,8 @@ func (oc *DefaultNetworkController) setupUDNACLs(mgmtPortIPs []net.IP) error {
6365 pgName := libovsdbutil .GetPortGroupName (pgIDs )
6466 egressDenyIDs := oc .getUDNACLDbIDs (DenySecondaryACL , libovsdbutil .ACLEgress )
6567 match := libovsdbutil .GetACLMatch (pgName , "" , libovsdbutil .ACLEgress )
66- egressDenyACL := libovsdbutil .BuildACL (egressDenyIDs , types .PrimaryUDNDenyPriority , match , nbdb .ACLActionDrop , nil , libovsdbutil .LportEgress )
68+ egressDenyACL := libovsdbutil .BuildACL (egressDenyIDs , types .PrimaryUDNDenyPriority , match , nbdb .ACLActionDrop ,
69+ nil , libovsdbutil .LportEgress , isolationTier )
6770
6871 getARPMatch := func (direction libovsdbutil.ACLDirection ) string {
6972 match := "("
@@ -89,15 +92,18 @@ func (oc *DefaultNetworkController) setupUDNACLs(mgmtPortIPs []net.IP) error {
8992
9093 egressARPIDs := oc .getUDNACLDbIDs (AllowHostARPACL , libovsdbutil .ACLEgress )
9194 match = libovsdbutil .GetACLMatch (pgName , getARPMatch (libovsdbutil .ACLEgress ), libovsdbutil .ACLEgress )
92- egressARPACL := libovsdbutil .BuildACL (egressARPIDs , types .PrimaryUDNAllowPriority , match , nbdb .ACLActionAllow , nil , libovsdbutil .LportEgress )
95+ egressARPACL := libovsdbutil .BuildACL (egressARPIDs , types .PrimaryUDNAllowPriority , match , nbdb .ACLActionAllow ,
96+ nil , libovsdbutil .LportEgress , isolationTier )
9397
9498 ingressDenyIDs := oc .getUDNACLDbIDs (DenySecondaryACL , libovsdbutil .ACLIngress )
9599 match = libovsdbutil .GetACLMatch (pgName , "" , libovsdbutil .ACLIngress )
96- ingressDenyACL := libovsdbutil .BuildACL (ingressDenyIDs , types .PrimaryUDNDenyPriority , match , nbdb .ACLActionDrop , nil , libovsdbutil .LportIngress )
100+ ingressDenyACL := libovsdbutil .BuildACL (ingressDenyIDs , types .PrimaryUDNDenyPriority , match , nbdb .ACLActionDrop ,
101+ nil , libovsdbutil .LportIngress , isolationTier )
97102
98103 ingressARPIDs := oc .getUDNACLDbIDs (AllowHostARPACL , libovsdbutil .ACLIngress )
99104 match = libovsdbutil .GetACLMatch (pgName , getARPMatch (libovsdbutil .ACLIngress ), libovsdbutil .ACLIngress )
100- ingressARPACL := libovsdbutil .BuildACL (ingressARPIDs , types .PrimaryUDNAllowPriority , match , nbdb .ACLActionAllow , nil , libovsdbutil .LportIngress )
105+ ingressARPACL := libovsdbutil .BuildACL (ingressARPIDs , types .PrimaryUDNAllowPriority , match , nbdb .ACLActionAllow ,
106+ nil , libovsdbutil .LportIngress , isolationTier )
101107
102108 ingressAllowIDs := oc .getUDNACLDbIDs (AllowHostSecondaryACL , libovsdbutil .ACLIngress )
103109 match = "("
@@ -114,7 +120,8 @@ func (oc *DefaultNetworkController) setupUDNACLs(mgmtPortIPs []net.IP) error {
114120 }
115121 match += ")"
116122 match = libovsdbutil .GetACLMatch (pgName , match , libovsdbutil .ACLIngress )
117- ingressAllowACL := libovsdbutil .BuildACL (ingressAllowIDs , types .PrimaryUDNAllowPriority , match , nbdb .ACLActionAllowRelated , nil , libovsdbutil .LportIngress )
123+ ingressAllowACL := libovsdbutil .BuildACL (ingressAllowIDs , types .PrimaryUDNAllowPriority , match , nbdb .ACLActionAllowRelated ,
124+ nil , libovsdbutil .LportIngress , isolationTier )
118125
119126 ops , err := libovsdbops .CreateOrUpdateACLsOps (oc .nbClient , nil , oc .GetSamplingConfig (), egressDenyACL , egressARPACL , ingressARPACL , ingressDenyACL , ingressAllowACL )
120127 if err != nil {
@@ -200,11 +207,11 @@ func (oc *DefaultNetworkController) setUDNPodOpenPortsOps(podNamespacedName stri
200207 // don't return on parseErr, as we need to cleanup potentially present ACLs from the previous config
201208 ingressIDs := oc .getUDNOpenPortDbIDs (podNamespacedName , libovsdbutil .ACLIngress )
202209 ingressACL := libovsdbutil .BuildACL (ingressIDs , types .PrimaryUDNAllowPriority ,
203- ingressMatch , nbdb .ACLActionAllowRelated , nil , libovsdbutil .LportIngress )
210+ ingressMatch , nbdb .ACLActionAllowRelated , nil , libovsdbutil .LportIngress , isolationTier )
204211
205212 egressIDs := oc .getUDNOpenPortDbIDs (podNamespacedName , libovsdbutil .ACLEgress )
206213 egressACL := libovsdbutil .BuildACL (egressIDs , types .PrimaryUDNAllowPriority ,
207- egressMatch , nbdb .ACLActionAllow , nil , libovsdbutil .LportEgress )
214+ egressMatch , nbdb .ACLActionAllow , nil , libovsdbutil .LportEgress , isolationTier )
208215
209216 var err error
210217 if ingressMatch == "" && egressMatch == "" || parseErr != nil {
@@ -288,8 +295,8 @@ func BuildAdvertisedNetworkSubnetsDropACL(advertisedNetworkSubnetsAddressSet add
288295 strings .Join (dropMatches , " || " ),
289296 nbdb .ACLActionDrop ,
290297 nil ,
291- libovsdbutil .LportEgressAfterLB )
292- dropACL . Tier = types . PrimaryACLTier
298+ libovsdbutil .LportEgressAfterLB ,
299+ isolationTier )
293300 return dropACL
294301}
295302
@@ -331,8 +338,8 @@ func (bnc *BaseNetworkController) addAdvertisedNetworkIsolation(nodeName string)
331338 strings .Join (passMatches , " || " ),
332339 nbdb .ACLActionPass ,
333340 nil ,
334- libovsdbutil .LportEgressAfterLB )
335- passACL . Tier = types . PrimaryACLTier
341+ libovsdbutil .LportEgressAfterLB ,
342+ isolationTier )
336343
337344 ops , err = libovsdbops .CreateOrUpdateACLsOps (bnc .nbClient , ops , nil , passACL )
338345 if err != nil {
0 commit comments