-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add egress-router-cni to the docs (OSDOCS-979) #28609
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| // Module included in the following assemblies: | ||
| // | ||
| // * networking/ovn_kubernetes_network_provider/deploying-egress-router-ovn-redirection.adoc | ||
|
|
||
| ifeval::["{context}" == "deploying-egress-router-ovn-redirection"] | ||
| :redirect: | ||
| :router-type: redirect | ||
| endif::[] | ||
|
|
||
| [id="nw-egress-router-network-attachment_{context}"] | ||
| = Network attachment definition for an egress router in {router-type} mode | ||
|
|
||
| Before a pod can act as an egress router, you must specify the network interface configuration as a `NetworkAttachmentDefinition` object. The object specifies information such as the IP address to attach to the egress router pod, the network destinations, and a network gateway. As the pod for the egress router starts, Multus uses the network attachment definition to add a network interface with the specified properties to the pod. | ||
|
|
||
| .Example network attachment definition | ||
| [source,yaml] | ||
| ---- | ||
| apiVersion: "k8s.cni.cncf.io/v1" | ||
| kind: NetworkAttachmentDefinition | ||
| metadata: | ||
| name: egress-router-redirect <.> | ||
| spec: | ||
| config: '{ | ||
| "cniVersion": "0.4.0", | ||
| "type": "egress-router", | ||
| "name": "egress-router", | ||
| "ip": { | ||
| "addresses": [ | ||
| "192.168.12.99/24" <.> | ||
| ], | ||
| "destinations": [ | ||
| "192.168.12.91/32" <.> | ||
| ], | ||
| "gateway": "192.168.12.1" <.> | ||
| } | ||
| }' | ||
| ---- | ||
| <.> The name of the network attachment definition is used later in the specification for the egress router pod. | ||
|
|
||
| <.> The `addresses` key specifies the reserved source IP address to use with the additional network interface. Specify a single IP address in CIDR notation, such as `192.168.12.99/24`. | ||
|
|
||
| <.> The `destinations` key specifies a single IP address in CIDR notation that the egress router sends packets to. The network address translation (NAT) tables for the egress router pod are configured so that connections to the cluster IP address of the pod are redirected to the same port on the destination IP address. Using this example, connections to the pod are redirected to `192.168.12.91`, with a source IP address of `192.168.12.99`. | ||
|
|
||
| <.> The `gateway` key specifies the IP address for the network gateway. | ||
|
|
||
| // clear temporary attributes | ||
| :!router-type: | ||
| ifdef::redirect[] | ||
| :!redirect: | ||
| endif::[] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| // Module included in the following assemblies: | ||
| // | ||
| // * networking/ovn_kubernetes_network_provider/deploying-egress-router-ovn-redirection.adoc | ||
|
|
||
| ifeval::["{context}" == "deploying-egress-router-ovn-redirection"] | ||
| :redirect: | ||
| :router-type: redirect | ||
| // Like nw-egress-router-pod, monitor bz-1896170 | ||
| :egress-pod-image-name: registry.redhat.com/openshift3/ose-pod | ||
| endif::[] | ||
|
|
||
| // Images are different for OKD | ||
| ifdef::openshift-origin[] | ||
|
|
||
| ifdef::redirect[] | ||
| :egress-pod-image-name: quay.io/openshift/origin-pod | ||
| endif::[] | ||
|
|
||
| endif::[] | ||
|
|
||
| [id="nw-egress-router-cni-pod_{context}"] | ||
| = Egress router pod specification for {router-type} mode | ||
|
|
||
| After you create a network attachment definition, you add a pod that references the definition. | ||
|
|
||
| .Example egress router pod specification | ||
| [source,yaml,subs="attributes+"] | ||
| ---- | ||
| apiVersion: v1 | ||
| kind: Pod | ||
| metadata: | ||
| name: egress-router-pod | ||
| annotations: | ||
| k8s.v1.cni.cncf.io/networks: egress-router-redirect <.> | ||
| spec: | ||
| containers: | ||
| - name: egress-router-pod | ||
| image: {egress-pod-image-name} | ||
| ---- | ||
| <.> The specified network must match the name of the network attachment definition. You can specify a namespace, interface name, or both, by replacing the values in the following pattern: `<namespace>/<network>@<interface>`. By default, Multus adds a secondary network interface to the pod with a name such as `net1`, `net2`, and so on. | ||
|
|
||
| // Clear temporary attributes | ||
| :!router-type: | ||
| :!egress-pod-image-name: | ||
| ifdef::redirect[] | ||
| :!redirect: | ||
| endif::[] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'd have to have a style check on
iptables; I'd almost be tempted to say Netfilter instead, but iptables is the more common way of referring to packet filtering on Linux.