Bug 1977279

Summary: When applying the gateway annotation to a gateway pod or to a namespace, the per pod SNAT is not removed
Product: OpenShift Container Platform Reporter: Federico Paolinelli <fpaoline>
Component: NetworkingAssignee: Federico Paolinelli <fpaoline>
Networking sub component: ovn-kubernetes QA Contact: Arti Sood <asood>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: asood, bbennett, rbrattai, zzhao
Version: 4.9   
Target Milestone: ---   
Target Release: 4.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-18 17:36:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1977330    
Bug Blocks:    

Description Federico Paolinelli 2021-06-29 11:31:27 UTC
Description of problem:

When using external gw annotations, the pod traffic is supposed to go out not snat-ed.
When a gateway pod exists but we add the annotation later, the pods belonging to the namespace do not get de-snatted

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Create a gw pod with the gw annotations (and a secondary network)

      k8s.ovn.org/routing-network: foo <- this must be the name of the secondary network
      k8s.v1.cni.cncf.io/network-status: '[{"name":"foo","interface":"net1","ips":["172.19.0.5"],"mac":"01:23:45:67:89:10"}]'


2. Add the ns annotation later:

k8s.ovn.org/routing-namespaces: externalgw-pod-novxlan-8081




Actual results:

Check that the pods traffic is going out SN-atted with the node's IP

Expected results:

The pods should go out directed to the gw pod with its IP

Additional info:

Comment 1 Federico Paolinelli 2021-06-29 14:52:58 UTC
Adding another scenario:

With DisableSNATMultipleGWs enabled, add a "k8s.ovn.org/routing-external-gws" annotation to the namespace.
The SNAT from the pod is still not removed.

Comment 11 errata-xmlrpc 2021-10-18 17:36:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.9.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:3759