-
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
Conversation
|
@mikemckiernan, maybe this is useful too: openshift/egress-router-cni#25 |
|
The preview will be available shortly at: |
jboxman
left a comment
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.
Added some notes for your review.
networking/ovn_kubernetes_network_provider/using-an-egress-router-ovn.adoc
Outdated
Show resolved
Hide resolved
networking/ovn_kubernetes_network_provider/using-an-egress-router-ovn.adoc
Outdated
Show resolved
Hide resolved
networking/ovn_kubernetes_network_provider/deploying-egress-router-ovn-redirection.adoc
Outdated
Show resolved
Hide resolved
networking/ovn_kubernetes_network_provider/deploying-egress-router-ovn-redirection.adoc
Show resolved
Hide resolved
| == Egress router modes | ||
|
|
||
| In _redirect mode_, an egress router pod sets up iptables rules to redirect traffic from its own IP address to one or more destination IP addresses. Client pods that need to use the reserved source IP address must be modified to connect to the egress router rather than connecting directly to the destination IP. | ||
| In _redirect mode_, an egress router pod configures `iptables` rules to redirect traffic from its own IP address to one or more destination IP addresses. Client pods that need to use the reserved source IP address must be modified to connect to the egress router rather than connecting directly to the destination IP. |
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.
| + | ||
| After you create the service, your pods can connect to the service. Their connections are redirected to the corresponding ports on the destination IP address and the connections originate from the reserved source IP address. | ||
|
|
||
| .Verification steps |
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 is awesome.
|
|
||
| .Verification steps | ||
|
|
||
| To verify that the egress router pod started and Multus attached a second network interface, complete the following procedure: |
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;
s/second/secondary/?
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 secondary is consistent with elsewhere, then certainly. One thought this triggers is that I don't think I indicated that a new default route is added and the route uses the primary (?) interface, eth0.
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.
Well, the route thing is a different topic, please see: openshift/egress-router-cni#27
but you can check that the routes will be as follows
default via 192.168.111.1 dev net1
10.128.2.0/23 dev eth0 proto kernel scope link src 10.128.2.164
192.168.111.0/24 dev net1 proto kernel scope link src 192.168.111.200
192.168.111.1 dev net1
being 192.168.11.1 the gateway and net1the macvlan interface
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.
As a noob, the output of ip ro show was clearest to me. The only way that I know to show that output is oc exec -it... but A) doesn't that add some tainted cooties to the pod? and B) I'm unsure if that teeters from verification into troubleshooting. I'll noodle with Jason or other writers if I find that my understanding of "A" is incorrect.
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.
What you could do this time to get to the ip ro showoutput is just oc rsh the actual pod ip, and then run the command. You can also go to the network namespace, enter it and run the command from the host as well. If you feel that that would help verification I'm happy to provide detailed commands (which IIRC are in the developer's guide as well). TL; DR the idea about the routing is, everything but the cluster network, out using the provided gateway, and that gateway out using the macvlan interface.
| ifeval::["{context}" == "deploying-egress-router-cni-redirection"] | ||
| :redirect: | ||
| :router-type: redirect | ||
| :image-name: FIXME |
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 might vary between OCP and OKD, as well.
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.
@danielmellado , @weliang1 , I'm too confused to even hazard a guess. Will Multus in OKD also copy the binary? If yes, do we need a "wait/sleep" image and are there separate images for OCP and OKD.
I'm really looking forward to the day when I can answer some of my own questions.
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.
hmmm, well, the image really gets copied by the multus' daemonset on CNO. Not sure if that really applies to OKD
| ---- | ||
| <.> 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. |
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.
It might be worth checking if this array can hold only a single value, or if multiple values are permissible.
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.
multiple values will be permissible, stay with 1 for 4.7 just in case
|
@danielmellado , @weliang1 , can you review the changes too? Some questions off the bat:
I'll think of another question right after I add this comment. Thanks. |
danielmellado
left a comment
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.
Hi, left a few comments/answers around! Feel free pinging if you need any additional ones!
| ---- | ||
| <.> 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. |
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.
multiple values will be permissible, stay with 1 for 4.7 just in case
| ifeval::["{context}" == "deploying-egress-router-cni-redirection"] | ||
| :redirect: | ||
| :router-type: redirect | ||
| :image-name: FIXME |
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.
hmmm, well, the image really gets copied by the multus' daemonset on CNO. Not sure if that really applies to OKD
|
|
||
| .Verification steps | ||
|
|
||
| To verify that the egress router pod started and Multus attached a second network interface, complete the following procedure: |
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.
Well, the route thing is a different topic, please see: openshift/egress-router-cni#27
but you can check that the routes will be as follows
default via 192.168.111.1 dev net1
10.128.2.0/23 dev eth0 proto kernel scope link src 10.128.2.164
192.168.111.0/24 dev net1 proto kernel scope link src 192.168.111.200
192.168.111.1 dev net1
being 192.168.11.1 the gateway and net1the macvlan interface
networking/ovn_kubernetes_network_provider/deploying-egress-router-ovn-redirection.adoc
Outdated
Show resolved
Hide resolved
networking/ovn_kubernetes_network_provider/using-an-egress-router-ovn.adoc
Outdated
Show resolved
Hide resolved
networking/ovn_kubernetes_network_provider/using-an-egress-router-ovn.adoc
Outdated
Show resolved
Hide resolved
I've just tried to pull that image and it works, maybe an issue on the docker rate limiting?
As long as the pod gets the label to get attached to the NAD that is previously created, any image can be used. For the record, we can mention that such pod would need to be running.
Yeah, we expect CIDR notation for both addresses and destinations, as per the gateway, we assume a /32 for it. See yet another example of a NAD configuring the CNI plugin
We'll be adding that part soon, as of now yeah, it just takes one, (https://github.com/openshift/egress-router-cni/blob/master/pkg/macvlan/macvlan.go#L297)
I just wanted to be somehow coherent with the blogpost explaining the legacy ER [1], so I chose to add that, we could change that to MySQL port or whatever ;)
|
|
Deploy preview for osdocs ready! Built with commit 864fd3d252b968e23c4e314dd627c508999b97cb |
|
The HTML is available at the foll URL and by following the link at the bottom of that page: https://deploy-preview-28609--osdocs.netlify.app/openshift-enterprise/latest/networking/ovn_kubernetes_network_provider/using-an-egress-router-ovn.html Next:
Thanks again. |
|
Deploy preview for osdocs ready! Built with commit ee39e82 |
|
@weliang1, PTAL. @danielmellado, I welcome another look, but want to thank you for all your help so far. At this point, any mistakes are invisible to me. |
|
/assign @weliang1 |
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.
@danielmellado Do we also need check iptables rules here by running below cmd?
[root@ip-10-0-134-247 /]# iptables-save -t nat
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A PREROUTING -i eth0 -j DNAT --to-destination 172.217.7.142
-A POSTROUTING -o net1 -j SNAT --to-source 10.0.134.248
COMMIT
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.
@danielmellado May use "ip netns exec testing iptables -t nat -L" from https://github.com/openshift/egress-router-cni/blob/5f6271341c454d02c63abe40f3c948c2b5b58247/docs/content/post/developer-documentation.md
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.
it's basically up to the user, both commands would be equivalent ;)
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
|
New changes are detected. LGTM label has been removed. |
|
@openshift/team-documentation, PTAL. Jason already added the right labels and milestone. /hold cancel |
bobfuru
left a comment
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.
A few minor comments but overall this is great work!
* Initiated by dmellado. * Add topic for deploying a redirect egress router. * Reorganized for modularization. * Feedback from Jason and Daniel. * Update the image names. The pod just needs to remain running. * Eng and QE reviewed. Some passive-to-active voice updates too. * Peer review from Bob.
|
LGTM |
|
/cherrypick enterprise-4.7 |
|
@bobfuru: new pull request created: #29200 DetailsIn 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 kubernetes/test-infra repository. |
Initiated by dmellado.
This is a followup PR to Daniel's: #28549.
Lingo and restructure changes are underway.
/hold