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
Add EnableUnidling flag to openshift-sdn #214
Add EnableUnidling flag to openshift-sdn #214
Conversation
So how does that help? Also, there's a typo in the commit message: "preivously" |
Ah, duh, never mind, it helps by filling in the default value of |
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.
Looks good. Go ahead and submit the API changes.
API changes merged, rebased, revendored, etc. etc. @danwinship, PTAL |
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.
Typo in the call ApplyDefaults on the previously-applied configuration
commit message: "preivously"
README.md
Outdated
@@ -114,6 +114,7 @@ OpenShiftSDN supports the following configuration options, all of which are opti | |||
* `vxlanPort`: The port to use for the VXLAN overlay. The default is 4789 | |||
* `MTU`: The MTU to use for the VXLAN overlay. The default is the MTU of the node that the cluster-network-operator is first run on, minus 50 bytes for overhead. If the nodes in your cluster don't all have the same MTU then you will need to set this explicitly. | |||
* `useExternalOpenvswitch`: boolean. If the nodes are already running openvswitch, and OpenShiftSDN should not install its own, set this to true. This only needed for certain advanced installations with DPDK or OpenStack. | |||
* `enableUnidling`: boolean. Whether or not the service proxy supports idling and unidling of services. |
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.
"Whether the service proxy should allow idling and unidling of services"
@@ -48,9 +48,13 @@ func renderOpenShiftSDN(conf *operv1.NetworkSpec, manifestDir string) ([]*uns.Un | |||
"metrics-bind-address": {"0.0.0.0"}, | |||
"metrics-port": {"9101"}, | |||
"healthz-port": {"10256"}, | |||
"proxy-mode": {"iptables"}, | |||
"proxy-mode": {"unidling+iptables"}, |
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 wrong: we have to apply the value of c.EnableUnidling
after merging conf
and kpcDefaults
. If a 4.1 user redundantly specified proxy-mode: iptables
, then in 4.1 they would have gotten unidling, but the way this code is currently written here, in 4.2 they would get no unidling. (There should be a test case for this.)
(The simplest way to do this might be to pass c.EnableUnidling
to kubeProxyConfiguration()
.)
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.
Argh, good point. The "unidling+" is an implementation detail.
This is to make it more likely that we don't accidentally reject a safe upgrade as unsafe. Also, add a test that includes known deployed previously-applied configurations, and ensures that they will always upgrade safely.
OK, fixed. Thanks a ton for the review. Solved the proxy-mode thing a slightly different way. PTAL. |
pkg/network/openshift_sdn.go
Outdated
kpcOverrides := map[string]operv1.ProxyArgumentList{} | ||
if *c.EnableUnidling && len(conf.KubeProxyConfig.ProxyArguments["proxy-mode"]) > 0 { | ||
pma := conf.KubeProxyConfig.ProxyArguments["proxy-mode"] | ||
if !strings.HasPrefix(pma[0], "unidling+") { |
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.
FWIW, validation has already confirmed that if *c.EnableUnidling
is set (after defaulting), then conf.KubeProxyConfig.ProxyArguments["proxy-mode"]
is either unset or ["iptables"]
. So you can simplify this to just:
kpcOverrides := map[string]operv1.ProxyArgumentList{}
if *c.EnableUnidling {
kpcOverrides["proxy-mode"] = operv1.ProxyArgumentList{"unidling+iptables"}`
}
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.
Ah yeah, good point.
pkg/network/openshift_sdn.go
Outdated
|
||
} | ||
|
||
kpc, err := kubeProxyConfiguration(conf, kpcDefaults, kpcOverrides) |
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 rearrange to defaults, config, overrides
to match the order they're merged in? or not
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.
yeah, thought about that. might as well be nice to future maintainers.
This also carries forward any possible 4.1 installations with --proxy-mode=iptables.
Updated, PTAL. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danwinship, squeed The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
This PR has 2 changes:
If this all looks good, I'll split off an api PR.