Skip to content

Commit a03fd49

Browse files
committed
Document how to use the SYN eater iptables change to protect router reloads
This documents the steps needed to enable the SYN eater to prevent connection drops when the haproxy used by the router reloads. In order to work its magic it needs to use iptables, which entails all sorts of fussing to get the router user to have the needed permissions, and to patch the deployment config to make it request a privileged container.
1 parent 6a2ed07 commit a03fd49

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

install_config/install/deploy_router.adoc

+51
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,57 @@ $ echo " router metrics at: http://<ip>:9090/consoles/haproxy.html "
10301030
====
10311031

10321032

1033+
=== Preventing Connection Failures During Restarts
1034+
1035+
If you connect to the router while the proxy is reloading, there is a
1036+
small chance that your connection will end up in the wrong network
1037+
queue and be dropped. The issue is being addressed. In the meantime,
1038+
it is possible to work around the problem by installing *_iptables_*
1039+
rules to prevent connections during the reload window. However, doing
1040+
so means that the router needs to run with elevated privilege so that
1041+
it can manipulate *_iptables_* on the host. It also means that
1042+
connections that happen during the reload are temporarily ignored and
1043+
will have to retransmit their connection start, lengthening the time
1044+
it takes to connect, but preventing connection failure.
1045+
1046+
Due to these issues, do not enable this option most of the time.
1047+
However, if you decide you must try to prevent this case from
1048+
happening, you can make the router use *_iptables_* by changing the
1049+
service account, and setting an environment variable on the router.
1050+
1051+
*Use a Privileged SCC*
1052+
1053+
When creating the router, allow it to use the privileged SCC. That
1054+
this gives the router user the ability to create containers with root
1055+
privileges on the nodes.
1056+
----
1057+
$ oadm policy add-scc-to-user privileged -z router
1058+
----
1059+
1060+
*Patch the Router Deployment Configuration to Create a Privileged Container*
1061+
1062+
Now that the router use can create privileged containers, make the
1063+
router deployment configuration use the power so that the router can
1064+
set the iptables rules it needs. This patch changes the router
1065+
deployment configuration so that the containter that is created runs
1066+
as root.
1067+
----
1068+
$ oc patch dc router -p '{"spec":{"template":{"spec":{"containers":[{"name":"router","securityContext":{"privileged":true}}]}}}}'
1069+
----
1070+
1071+
*Tell the Router to Use iptables*
1072+
1073+
Set the option on the router deployment configuration. If you used a
1074+
non-default name for the router, you will have to change *_dc/router_*
1075+
accordingly):
1076+
1077+
====
1078+
----
1079+
oc set env dc/router -c router DROP_SYN_DURING_RESTART=true
1080+
----
1081+
====
1082+
1083+
10331084
[[deploying-customized-router]]
10341085
== Deploying a Customized HAProxy Router
10351086

0 commit comments

Comments
 (0)