Skip to content

OSDOCS-10661:updates for local gateway mode #90373

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

Merged
merged 1 commit into from
Apr 2, 2025

Conversation

JoeAldinger
Copy link
Contributor

@JoeAldinger JoeAldinger commented Mar 17, 2025

Version(s):
4.17+

Issue:
https://issues.redhat.com/browse/OSDOCS-10661

Link to docs preview:
https://90373--ocpdocs-pr.netlify.app/openshift-enterprise/latest/networking/ovn_kubernetes_network_provider/configuring-gateway-mode

QE review:

  • QE has approved this change.

Additional information:
PR that adds local gateway procedural change to OVN-K docs: #90975

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 17, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 17, 2025

@JoeAldinger: This pull request references OSDOCS-10661 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target either version "4.19." or "openshift-4.19.", but it targets "openshift-4.16.z" instead.

In response to this:

Version(s):

Issue:

Link to docs preview:

QE review:

  • QE has approved this change.

Additional information:

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.

@openshift-ci openshift-ci bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 17, 2025
@ocpdocs-previewbot
Copy link

ocpdocs-previewbot commented Mar 17, 2025

🤖 Wed Apr 02 15:13:52 - Prow CI generated the docs preview:
https://90373--ocpdocs-pr.netlify.app
Complete list of updated preview URLs: artifacts/updated_preview_urls.txt

@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 19, 2025

@JoeAldinger: This pull request references OSDOCS-10661 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target either version "4.19." or "openshift-4.19.", but it targets "openshift-4.16.z" instead.

In response to this:

Version(s):

Issue:
https://issues.redhat.com/browse/OSDOCS-10661

Link to docs preview:

QE review:

  • QE has approved this change.

Additional information:

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.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 19, 2025

@JoeAldinger: This pull request references OSDOCS-10661 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target either version "4.19." or "openshift-4.19.", but it targets "openshift-4.16.z" instead.

In response to this:

Version(s):

Issue:
https://issues.redhat.com/browse/OSDOCS-10661

Link to docs preview:
https://90373--ocpdocs-pr.netlify.app/openshift-enterprise/latest/networking/ovn_kubernetes_network_provider/configuring-gateway-mode

QE review:

  • QE has approved this change.

Additional information:

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.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 24, 2025

@JoeAldinger: This pull request references OSDOCS-10661 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target either version "4.19." or "openshift-4.19.", but it targets "openshift-4.16.z" instead.

In response to this:

Version(s):

Issue:
https://issues.redhat.com/browse/OSDOCS-10661

Link to docs preview:
https://90373--ocpdocs-pr.netlify.app/openshift-enterprise/latest/networking/ovn_kubernetes_network_provider/configuring-gateway-mode

QE review:

  • QE has approved this change.

Additional information:
PR that adds local gateway procedural change to OVN-K docs: #90975

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.

@ahardin-rh
Copy link
Contributor

LGTM. Thanks!

@CFields651
Copy link

LGTM! @palonsoro Can you have a look too please?

@@ -206,7 +206,7 @@ endif::operator[]

|`gatewayConfig`
|`object`
|Optional: Specify a configuration object for customizing how egress traffic is sent to the node gateway.
|Optional: Specify a configuration object for customizing how egress traffic is sent to the node gateway. Accepted values are `Shared` and `Local`. The default value is `Shared`. In the default setting, all external traffic leaving the cluster is routed through a centralized gateway node and pods use a single egress IP for outbound traffic. In the `Local` setting, external traffic from pods exits through the node that it is running on. Each node serves as its own gateway.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect. In both Shared and Local gateway modes, the traffic exits from the pod node unless it has to use an egress IP located in a different node.

The difference between Shared and Local is that, in Shared, OVS outputs traffic directly to the node IP interface, while in Local it traverses the host network (so it gets applied the routing table of the host, etc.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be possible that you are misinterpreting some details on how the logical architecture at OVN level used to be described. But here it is best to stick to what happens physically, which is what I described above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated


As a cluster administrator you can configure the gateway mode using the `gatewayConfig` spec in the Cluster Network Operator. The following procedure can be used to set the `routingViaHost` field to `true` for local mode or `false` for shared mode.

You might follow the optional step 4 to enable IP forwarding alongside local gateway mode if you require node level traffic control. For example, possible use cases for combining local gateway mode with IP forwarding include:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enabling IP forwarding toes not allow "node level traffic control", so that sentence should be removed. It allows the host network of the node to act as router for traffic not related to OVN-Kubernetes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

ipsecConfig:
# ...
----
<1> A value of `true` sets local gateway mode and a value of `false` sets shared gateway mode.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be easier for customers to understand if we bring the "shared gateway" and "logical gateway" to the background and favor talking about "we are routing through the host" or "we aren't routing through the host". I am not talking about removing the terminology (because users know it already) but easing the explanation that way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


As a cluster administrator you can configure the `gatewayConfig` object to manage how external traffic leaves the cluster. You do so by setting the `routingViaHost` spec to `true` for local mode or `false` for local mode.

In the shared mode traffic is forwarded from pods in the cluster to a shared centralized node where it exits the cluster. In the local mode, each node serves as its own gateway so that traffic exits from a pod through the node it is running on.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, this is wrong or, at least, misleading. Traffic always goes out from the pod node (unless there is an egress IP in place). The difference is whether it traverses the host network stack or OVS sends it directly to the physical interface.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reworded

@palonsoro
Copy link
Contributor

LGTM now. Thanks!

@JoeAldinger JoeAldinger added the peer-review-needed Signifies that the peer review team needs to review this PR label Apr 1, 2025
@skopacz1 skopacz1 added the peer-review-in-progress Signifies that the peer review team is reviewing this PR label Apr 1, 2025
@JoeAldinger JoeAldinger added this to the Continuous Release milestone Apr 1, 2025
@JoeAldinger
Copy link
Contributor Author

@asood-rh can you help with the versions this should be applied to, please?

@asood-rh
Copy link

asood-rh commented Apr 1, 2025

@asood-rh can you help with the versions this should be applied to, please?

@JoeAldinger gateway mode is applicable to all the above versions that you added.

@asood-rh
Copy link

asood-rh commented Apr 1, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 1, 2025
Copy link
Contributor

@skopacz1 skopacz1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few comments, otherwise LGTM!

@@ -206,7 +206,7 @@ endif::operator[]

|`gatewayConfig`
|`object`
|Optional: Specify a configuration object for customizing how egress traffic is sent to the node gateway.
|Optional: Specify a configuration object for customizing how egress traffic is sent to the node gateway. Possible values are `Shared` and `Local`. The default value is `Shared`. In the default setting, the Open vSwitch (OVS) outputs traffic directly to the node IP interface, In the `Local` setting, it traverses the host network; consequently, it gets applied to the routing table of the host.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comma that should be a period:

Suggested change
|Optional: Specify a configuration object for customizing how egress traffic is sent to the node gateway. Possible values are `Shared` and `Local`. The default value is `Shared`. In the default setting, the Open vSwitch (OVS) outputs traffic directly to the node IP interface, In the `Local` setting, it traverses the host network; consequently, it gets applied to the routing table of the host.
|Optional: Specify a configuration object for customizing how egress traffic is sent to the node gateway. Possible values are `Shared` and `Local`. The default value is `Shared`. In the default setting, the Open vSwitch (OVS) outputs traffic directly to the node IP interface. In the `Local` setting, it traverses the host network; consequently, it gets applied to the routing table of the host.

@@ -206,7 +206,7 @@ endif::operator[]

|`gatewayConfig`
|`object`
|Optional: Specify a configuration object for customizing how egress traffic is sent to the node gateway.
|Optional: Specify a configuration object for customizing how egress traffic is sent to the node gateway. Possible values are `Shared` and `Local`. The default value is `Shared`. In the default setting, the Open vSwitch (OVS) outputs traffic directly to the node IP interface, In the `Local` setting, it traverses the host network; consequently, it gets applied to the routing table of the host.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggestion to consider, but maybe switch "possible" for "valid"? Unless there's a reason to keep it as is

Suggested change
|Optional: Specify a configuration object for customizing how egress traffic is sent to the node gateway. Possible values are `Shared` and `Local`. The default value is `Shared`. In the default setting, the Open vSwitch (OVS) outputs traffic directly to the node IP interface, In the `Local` setting, it traverses the host network; consequently, it gets applied to the routing table of the host.
|Optional: Specify a configuration object for customizing how egress traffic is sent to the node gateway. Valid values are `Shared` and `Local`. The default value is `Shared`. In the default setting, the Open vSwitch (OVS) outputs traffic directly to the node IP interface, In the `Local` setting, it traverses the host network; consequently, it gets applied to the routing table of the host.


toc::[]

As a cluster administrator you can configure the `gatewayConfig` object to manage how external traffic leaves the cluster. You do so by setting the `routingViaHost` spec to `true` for local mode or `false` for local mode.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the second sentence, it states that both options are for local mode, is this correct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. True is local mode, false is shared mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good catch. Thank you, @skopacz1


As a cluster administrator you can configure the gateway mode using the `gatewayConfig` spec in the Cluster Network Operator. The following procedure can be used to set the `routingViaHost` field to `true` for local mode or `false` for shared mode.

You might follow the optional step 4 to enable IP forwarding alongside local gateway mode if you need the host network of the node to act as a router for traffic not related to OVN-Kubernetes. For example, possible use cases for combining local gateway mode with IP forwarding include:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the ISG, "might" is used to indicate possibility ("this might happen"), while "can" is used to indicate ability ("You can do this action, if you want"). Do you think this is a case where you could use "can" to indicate that someone has the option to do this?

Suggested change
You might follow the optional step 4 to enable IP forwarding alongside local gateway mode if you need the host network of the node to act as a router for traffic not related to OVN-Kubernetes. For example, possible use cases for combining local gateway mode with IP forwarding include:
You can follow the optional step 4 to enable IP forwarding alongside local gateway mode if you need the host network of the node to act as a router for traffic not related to OVN-Kubernetes. For example, possible use cases for combining local gateway mode with IP forwarding include:

I don't know the context here so I will leave it up to you

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the best of my knowledge, "can" would make more sense as per your definition. But I'll let @JoeAldinger decide.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know I struggled with whether might or can should go here when I was writing this up. Good to have more than one input. I'm changing to can.

$ oc get network.operator cluster -o yaml > network-config-backup.yaml
----

. Set `routingViaHost` to `true` for local gateway mode by running the following command:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion to add a noun to the param for clarity:

Suggested change
. Set `routingViaHost` to `true` for local gateway mode by running the following command:
. Set the `routingViaHost` parameter to `true` for local gateway mode by running the following command:

----
$ oc patch network.operator cluster --type=merge -p '{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"gatewayConfig":{"ipForwarding": "Global"}}}}}'
----
.. Verify that `ipForwarding` spec has been set to `Global` by running the following command:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs an article here:

Suggested change
.. Verify that `ipForwarding` spec has been set to `Global` by running the following command:
.. Verify that the `ipForwarding` spec has been set to `Global` by running the following command:

@skopacz1 skopacz1 removed peer-review-in-progress Signifies that the peer review team is reviewing this PR peer-review-needed Signifies that the peer review team needs to review this PR labels Apr 1, 2025
@skopacz1 skopacz1 added the peer-review-done Signifies that the peer review team has reviewed this PR label Apr 1, 2025
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 2, 2025
Copy link

openshift-ci bot commented Apr 2, 2025

New changes are detected. LGTM label has been removed.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Apr 2, 2025

@JoeAldinger: This pull request references OSDOCS-10661 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target either version "4.19." or "openshift-4.19.", but it targets "openshift-4.16.z" instead.

In response to this:

Version(s):

Issue:
https://issues.redhat.com/browse/OSDOCS-10661

Link to docs preview:
https://90373--ocpdocs-pr.netlify.app/openshift-enterprise/latest/networking/ovn_kubernetes_network_provider/configuring-gateway-mode

QE review:

  • QE has approved this change.

Additional information:
PR that adds local gateway procedural change to OVN-K docs: #90975

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.

Copy link

openshift-ci bot commented Apr 2, 2025

@JoeAldinger: all tests passed!

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.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Apr 2, 2025

@JoeAldinger: This pull request references OSDOCS-10661 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target either version "4.19." or "openshift-4.19.", but it targets "openshift-4.16.z" instead.

In response to this:

Version(s):
4.17+

Issue:
https://issues.redhat.com/browse/OSDOCS-10661

Link to docs preview:
https://90373--ocpdocs-pr.netlify.app/openshift-enterprise/latest/networking/ovn_kubernetes_network_provider/configuring-gateway-mode

QE review:

  • QE has approved this change.

Additional information:
PR that adds local gateway procedural change to OVN-K docs: #90975

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.

@JoeAldinger JoeAldinger merged commit 82cdb7b into openshift:main Apr 2, 2025
2 checks passed
@JoeAldinger
Copy link
Contributor Author

/cherrypick enterprise-4.19

@JoeAldinger
Copy link
Contributor Author

/cherrypick enterprise-4.18

@JoeAldinger
Copy link
Contributor Author

/cherrypick enterprise-4.17

@openshift-cherrypick-robot

@JoeAldinger: new pull request created: #91537

In response to this:

/cherrypick enterprise-4.19

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.

@openshift-cherrypick-robot

@JoeAldinger: new pull request created: #91538

In response to this:

/cherrypick enterprise-4.18

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.

@openshift-cherrypick-robot

@JoeAldinger: new pull request created: #91539

In response to this:

/cherrypick enterprise-4.17

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.

@JoeAldinger
Copy link
Contributor Author

Confirmed with QE and SME that this is ok to CP to 4.16 given inflight PR: #90373

@JoeAldinger
Copy link
Contributor Author

/cherrypick enterprise-4.16

@openshift-cherrypick-robot

@JoeAldinger: new pull request created: #92139

In response to this:

/cherrypick enterprise-4.16

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch/enterprise-4.17 branch/enterprise-4.18 branch/enterprise-4.19 jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. peer-review-done Signifies that the peer review team has reviewed this PR size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants