-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add config flag 'enable-multi-external-gateway' #3715
Conversation
7b54518
to
cc024ae
Compare
If a flag is unset, it means disabled. We use the microshift binary to render ovnkube manifests, we don't need to generate them dynamically. |
cc024ae
to
63de0bc
Compare
if config.OVNKubernetesFeature.EnableMultiExternalGateway { | ||
nc.apbExternalRouteNodeController, err = apbroute.NewExternalNodeController( | ||
cnnci.apbExternalRouteClient, | ||
nc.watchFactory.PodCoreInformer(), | ||
nc.watchFactory.NamespaceInformer(), | ||
stopChan) | ||
if err != nil { | ||
return nil, err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe this can be initialized closer to where is used as nc.apbExternalRouteNodeController.Run
so we just check EnableMultiExternalGateway
once but this is just a thought I had, no problems if it is left as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the controller initialization to where nc.apbExternalRouteNodeController.Run
is invoked. But for the master code in default_network_controller.go
, I keep the apbroutecontroller.NewExternalMasterController
, since there are many other codes depends on the objects in the controller instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pliurh can you explain what happens in those situations where the code depends on apbroutecontroller
but EnableMultiExternalGateway is not set?
For example:
addGWRoutesForPod
seems to be doing something when it might not have to- Also
apbExternalRouteController.Repair
might be doing something different that what it would be supposed to do, if for example, we restart from a situation whereEnableMultiExternalGateway
was set to a being unset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When EnableMultiExternalGateway
is unset. The apbExternalRouteController
will not be running. So all the informers in the controller will not be started. I suppose addGWRoutesForPod
will do nothing for the apbRoutePolicies.
apbExternalRouteController.Repair
is more complicated, since it will also do things based on the annotation of pods and namespaces. If a cluster is always with EnableMultiExternalGateway
flag unchanged, it's safe. However with the case you talked about, if the associated annotations for pods and namespace are not cleaned, I am not sure what will happen.
Maybe @jordigilh can shed some light on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that func (oc *DefaultNetworkController) addGWRoutesForPod
still looks like it does something.
Is the plan to keep legacy egress gw functionality operating through pod & namespace annotations even if this flag is not set?
In regards to the repair, we decided we should not really be concerned with cleaning up if the flag transitioned from enabled to disabled, which is comparable to what we do with other toggle features. However, it looks like the repair might still be creating things even if the flag is unset, from processOVNRoute
called in Repair.
So should we just consider that the flag also applies to the legacy egress gw support and just check for this flag in all these places and just disable everything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I guess my only real concern here is that now that the sync for ecmp/exgw stuff has been moved from the default network controller to apb controller, by running ovnk without the apb controller enabled, it wont sync that stuff. I guess in microshift we dont care since we never used the legacy feature in the first place and in openshift we will always have the flag enabled, so I guess this isn't really a concern.
63de0bc
to
e51e106
Compare
@pliurh It looks lñike there are several places where we try to use Consequently some tests that depend on it will need to set that as well. |
c72aa93
to
1d0ab36
Compare
/retest |
Oops, something went wrong:
|
91f2a8b
to
4a93a85
Compare
ah again?! this is the second time i am running into this.. we need to track this as an issue: https://github.com/ovn-org/ovn-kubernetes/actions/runs/5440807530/jobs/9894410748?pr=3715 |
It won't sync whatever is sync'ing but after talking with @jordigilh that should not fundamentally affect the legacy extgw support through annotations. So I guess the approach we take here is to just disable support through the CRD. So we might be good to go. |
4a93a85
to
a640858
Compare
I tested disabling the flag and configuring MEG with annotations. This flag cannot block the annotation from working. So yes, it can only disable the support of the CRD approach. Disabling the annotation approach is more complicated. I suggest we take it as a tech debt, and resolve it in the future. |
a640858
to
113a2ae
Compare
113a2ae
to
6bfc988
Compare
Signed-off-by: Peng Liu <[email protected]>
6bfc988
to
0f11997
Compare
- What this PR does and why is it needed
Add config flag 'enable-multi-external-gateway'. It allows users to enable/disable the feature.
- Special notes for reviewers
- How to verify it
- Description for the changelog