Skip to content
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

Enable public ingress on nerc-ocp-prod #146

Merged
merged 4 commits into from
Nov 14, 2022

Conversation

larsks
Copy link
Member

@larsks larsks commented Nov 12, 2022

This pull request applies the configuration we developed to enable public ingress on the nerc-ocp-prod cluster. There are broadly three changes:

  1. Enable loose rp_filter mode (this prevents the kernel from simply dropping packets that ingress on the public network)

  2. Add some custom netfilter rules to managing connection and packet marks on public ingress traffic.

  3. Add policy routing rules that utilize the packet marks to direct replies to the appropriate default gateway.

Closes nerc-project/operations#16

The routes added by these files are technically correct, but due to the way
loadbalancer addresses are handled the rules don't apply to traffic in a
useful fashion.

Traffic coming from a service is modified by a masquerade rule in the
POSTROUTING chain to have the correct source address. Because this happens
*after* a routing decision has already been made, the outbound request
never matches the routing policy rules defined by these files.
There's no need to reproduce this file for every machineconfig directory.
Configure `net.ipv4.conf.all.rp_filter` on all worker nodes for "loose"
mode (`rp_filter=2`). This permits asymmetric routing, which is necessary
right now for cluster access via the public network.
This commit enables symmetric routing for requests on the public
address range. This requires a few changes:

1. Add custom netfilter rules that:

    - Add a connection mark to incoming requests on the public network.
    - Transfer the connection mark to the fwmark on reply packets
      originating from the serviceNetwork cidr rnage.

2. Add policy routing rules that match the fwmark so that replies
    to public requests use a custom route table.

3. Add rules to the custom table that direct replies to public
   requests out the appropriate default gateway.
@naved001 naved001 merged commit fbc4baf into OCP-on-NERC:main Nov 14, 2022
@larsks larsks deleted the fix/rpfilter branch March 31, 2023 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable public access to services on production cluster
4 participants