-
Notifications
You must be signed in to change notification settings - Fork 240
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
SDN 2316: Use GatewayConfig in OVN-K to set gateway modes #1209
SDN 2316: Use GatewayConfig in OVN-K to set gateway modes #1209
Conversation
b9996f3
to
7c7f406
Compare
81be268
to
b009be0
Compare
I have tested this PR against a cluster and it works as expected.
It rolls out local gateway as soon as we change the gatewayConfig and add the |
/test e2e-agnostic-upgrade |
b009be0
to
b105598
Compare
cfe1bf8
to
8ada60b
Compare
/hold |
2c91d1f
to
b081fb0
Compare
/hold cancel |
b081fb0
to
2c21678
Compare
/retest |
2c21678
to
cf87713
Compare
cf87713
to
ee42410
Compare
Let's remove the support for hidden config-map that was used to set gatewaymode values and instead use the new API `routingViaHost`. This PR also handles the upgrade logic for existing clusters and populates the routingViaHost field based on previous cluster state.
ee42410
to
5ee9f36
Compare
@tssurya: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest-required |
if modeOverride == OVN_LOCAL_GW_MODE { | ||
routeViaHost = true | ||
} | ||
conf.Spec.DefaultNetwork.OVNKubernetesConfig.GatewayConfig = &operv1.GatewayConfig{ |
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.
This doesn't actually update the config map right? Do we need to update the config map from here so that when we remove the ability to use the hidden configmap we dont break users? Or should we print some warning or event to tell the user they need to update the gatewayConfig in their configmap?
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.
We do update the configmap when this function returns. Let me explain:
case operv1.NetworkTypeOVNKubernetes: func bootstrapOVN(conf *operv1.Network, kubeClient client.Client) (*bootstrap.BootstrapResult, error) { func bootstrapOVNConfig(kubeClient client.Client) (*bootstrap.OVNConfigBoostrapResult, error) { - Within
bootstrapOVNConfig
we do our thing. - Then we return all the way back to the bootstrap call
bootstrapResult, err := network.Bootstrap(newOperConfig, r.client) - Aaaand this is where we update the CRD:
cluster-network-operator/pkg/controller/operconfig/operconfig_controller.go
Lines 200 to 201 in 38b07c3
if !reflect.DeepEqual(operConfig, newOperConfig) { if err := r.UpdateOperConfig(newOperConfig); err != nil {
Hence any changes done to the CRD during bootstrap gets written into the CRD. After all that the rendering starts and it regards the updated CRD the source of truth.
I tested it using the steps mentioned in https://docs.google.com/document/d/1SYaNQNW4sWVTE9XgHG6gKsS4ZActK8_Z7wILXU5YuoU/edit#heading=h.d5s838mpuww0 in a cluster-bot cluster and it works well. The CRD does get updated to something like:
Gateway Config:{
Routing Via Host: true
}
/test e2e-gcp-ovn-upgrade |
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: trozet, tssurya The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Depends On openshift/api#1033 and #1242
In this PR, we are doing two things:
routingViaHost
to configure gateway modes.We also handle the upgrade logic of populating the new API field in the cluster CRD based on the
gateway-mode-config
map values. Also note that this enables users to migrate between the two gateway modes at runtime.