-
Notifications
You must be signed in to change notification settings - Fork 252
OCPBUGS-55962: Provide config map to force loose isolation for UDN networks #2714
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
OCPBUGS-55962: Provide config map to force loose isolation for UDN networks #2714
Conversation
This commit provides support for configuring loose isolation mode for the BGP advertised UDN networks. The config map with name openshift-network-operator/udn-config-overrides must be created with "force-loose-isolation" key set to "true" which rolls out the loose mode by recreating ovnkube-node daemonset pods. Signed-off-by: Periyasamy Palanisamy <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pperiyasamy The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@pperiyasamy: This pull request references Jira Issue OCPBUGS-55962, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
/retest |
/retest |
@pperiyasamy: This pull request references Jira Issue OCPBUGS-55962, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
/assign @Meina-rh @anuragthehatter @jechen0648 |
@pperiyasamy: 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-sigs/prow repository. I understand the commands that are listed here. |
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.
Overall looks good apart from the minor comments. Do we have e2e tests for this feature in the origin repo?
// If the configmap doesn't exist, it returns false (the UDN isolation is protected by default). | ||
func isLooseUDNIsolationEnabled(client cnoclient.Client) (bool, error) { | ||
configMap := &corev1.ConfigMap{} | ||
if err := client.ClientFor("").CRClient().Get(context.TODO(), |
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.
if err := client.ClientFor("").CRClient().Get(context.TODO(), | |
if err := client.Default().CRClient().Get(context.TODO(), |
func isLooseUDNIsolationEnabled(client cnoclient.Client) (bool, error) { | ||
configMap := &corev1.ConfigMap{} | ||
if err := client.ClientFor("").CRClient().Get(context.TODO(), | ||
types.NamespacedName{Name: "udn-config-overrides", Namespace: names.APPLIED_NAMESPACE}, configMap); err != nil { |
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.
Should udn-config-overrides
be added as a constant? Then the constant can be used here.
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 was thinking if we should go more generic with the name and use ovn-kubernetes-config-overrides
and this be a more generic getOVNKConfigOverrides
returning a map. Just to prevent us from spreading on config map names.
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.
Can we just use the existing env-overrides
configmap instead of creating a new 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.
ConsolePluginCRDExists bool | ||
|
||
// LooseUDNIsolationModeEnabled set to true when loose isolation mode is enabled between two BGP advertised | ||
// UDN networks. In loose isolation mode, those network pods can communicate with each other accoding to |
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.
// UDN networks. In loose isolation mode, those network pods can communicate with each other accoding to | |
// UDN networks. In loose isolation mode, those network pods can communicate with each other according to |
nit
{{ if .IsLooseUDNIsolationEnabled }} | ||
- name: UDN_ISOLATION_MODE | ||
value: "loose" | ||
{{ end }} |
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 don't think this matches what ovn-kubernetes/ovn-kubernetes@3dd6149 expects. The setting there is called
ROUTED_UDN_ISOLATION
instead of UDN_ISOLATION_MODE
. Also the values it takes are Disabled
or Enabled
not loose
.
This should preferably be passed as a command line argument in script-lib
rather than an environment variable for consistency.
I think UDN_ISOLATION_MODE
is fine, I would probably use Strict
and Loose
for values rather than Disabledor
Enabled`.
return false, fmt.Errorf("unable to bootstrap OVN, unable to retrieve udn-config-overrides config: %s", err) | ||
} | ||
isLooseIsolationEnabled := configMap.Data["force-loose-isolation"] | ||
return isLooseIsolationEnabled == "true", nil |
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.
Maybe just use the same key/value that we pass to ovnk for consistency? So UDNRoutedIsolationMode
and Strict
,Loose
values? Any non expected value should return error.
func isLooseUDNIsolationEnabled(client cnoclient.Client) (bool, error) { | ||
configMap := &corev1.ConfigMap{} | ||
if err := client.ClientFor("").CRClient().Get(context.TODO(), | ||
types.NamespacedName{Name: "udn-config-overrides", Namespace: names.APPLIED_NAMESPACE}, configMap); err != nil { |
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 was thinking if we should go more generic with the name and use ovn-kubernetes-config-overrides
and this be a more generic getOVNKConfigOverrides
returning a map. Just to prevent us from spreading on config map names.
closing it in favor of #2752. |
@pperiyasamy: This pull request references Jira Issue OCPBUGS-55962. The bug has been updated to no longer refer to the pull request using the external bug tracker. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
This PR adds support for configuring loose isolation mode for the BGP advertised UDN networks. The config map with name
openshift-network-operator/udn-config-overrides
must be created withforce-loose-isolation
key set totrue
which rolls out the loose mode by recreatingovnkube-node
daemonset pods.Steps to roll out loose isolation mode: