Skip to content

Conversation

@frobware
Copy link
Contributor

@frobware frobware commented Apr 7, 2022

This implements openshift/enhancements#1084.

Requires openshift/api#1161 [MERGED]

@frobware frobware changed the title haproxy maxconn Allow maxConnections tuning option Apr 7, 2022
@frobware
Copy link
Contributor Author

frobware commented Apr 7, 2022

/hold

Needs the EP to be approved.
API change: openshift/api#1161

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 7, 2022
@frobware frobware changed the title Allow maxConnections tuning option Implement maxConnections tuning option Apr 7, 2022
@openshift-ci openshift-ci bot requested review from alebedev87 and knobunc April 7, 2022 18:57
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 7, 2022
@frobware frobware force-pushed the haproxy-maxconn branch 2 times, most recently from 9ce070e to 0471f55 Compare April 8, 2022 08:35
@frobware
Copy link
Contributor Author

frobware commented Apr 8, 2022

Errors:

  • [sig-scheduling][Early] The openshift-etcd pods should be scheduled on different nodes [Suite:openshift/conformance/parallel]

/retest

@frobware
Copy link
Contributor Author

configurable_route_test.go:101: error updating ingress.status: timed out waiting for the condition

/test e2e-aws-operator

Copy link
Contributor

@gcs278 gcs278 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@frobware frobware force-pushed the haproxy-maxconn branch 6 times, most recently from 124d543 to 9932463 Compare April 20, 2022 10:51
@frobware
Copy link
Contributor Author

/retest

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 23, 2022
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 25, 2022
@frobware frobware force-pushed the haproxy-maxconn branch 4 times, most recently from a7ba4cd to c086bda Compare April 27, 2022 11:58
@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Apr 29, 2022
Switch from the unsupported config override to the tuning option
introduced in openshift/api#1161.
@frobware
Copy link
Contributor Author

frobware commented May 3, 2022

/retest

@ahardin-rh
Copy link

/label docs-approved

@openshift-ci openshift-ci bot added the docs-approved Signifies that Docs has signed off on this PR label May 3, 2022
@frobware frobware changed the title Implement maxConnections tuning option https://issues.redhat.com/browse/NE-577 May 5, 2022
@sferich888
Copy link

/label px-approved

@openshift-ci openshift-ci bot added the px-approved Signifies that Product Support has signed off on this PR label May 5, 2022
@frobware frobware changed the title https://issues.redhat.com/browse/NE-577 NE-577: Support a Configurable ROUTER_MAX_CONNECTIONS in HAproxy May 5, 2022
Copy link
Contributor

@Miciah Miciah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few suggestions to simplify the code, but overall I would be fine with merging this as-is.

Raw: []byte(`{"loadBalancingAlgorithm":"random","dynamicConfigManager":"false","maxConnections":-1,"reloadInterval":15}`),
Raw: []byte(`{"loadBalancingAlgorithm":"random","dynamicConfigManager":"false","reloadInterval":15}`),
}
ic.Spec.TuningOptions.MaxConnections = -1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be moved above, here:

ic.Spec.TuningOptions = operatorv1.IngressControllerTuningOptions{
HeaderBufferBytes: 16384,
HeaderBufferMaxRewriteBytes: 4096,
ThreadCount: RouterHAProxyThreadsDefaultValue * 2,
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean above? I added MaxConnections as an addition after ThreadCount.

)

func TestTunableMaxConnectionsValidValues(t *testing.T) {
updateMaxConnections := func(t *testing.T, client client.Client, timeout time.Duration, maxConnections int32, c *operatorv1.IngressController) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems you only use c as a way to get the name of the object and then as a place to store the object that you get from the API, which is subtle. What do you think about replacing the *operatorv1.IngressController parameter with a types.NamespacedName parameter and using a local variable to store the object from the API?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make more sense just to use kclient and time.Minute instead of parameterizing the client and timeout?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want the caller to specify how long to wait for. And I'd rather not have a mismatch of globals and discrete parameter values.

Copy link
Contributor Author

@frobware frobware May 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems you only use c as a way to get the name of the object and then as a place to store > the object that you get from the API, which is subtle. What do you think about replacing the > *operatorv1.IngressController parameter with a types.NamespacedName parameter and using a >local variable to store the object from the API?

Done.

Comment on lines 47 to 53
conditions := []operatorv1.OperatorCondition{
{Type: operatorv1.IngressControllerAvailableConditionType, Status: operatorv1.ConditionTrue},
{Type: operatorv1.LoadBalancerManagedIngressConditionType, Status: operatorv1.ConditionFalse},
{Type: operatorv1.DNSManagedIngressConditionType, Status: operatorv1.ConditionFalse},
}
t.Logf("waiting for ingresscontroller %v", icName)
if err := waitForIngressControllerCondition(t, kclient, 5*time.Minute, icName, conditions...); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
conditions := []operatorv1.OperatorCondition{
{Type: operatorv1.IngressControllerAvailableConditionType, Status: operatorv1.ConditionTrue},
{Type: operatorv1.LoadBalancerManagedIngressConditionType, Status: operatorv1.ConditionFalse},
{Type: operatorv1.DNSManagedIngressConditionType, Status: operatorv1.ConditionFalse},
}
t.Logf("waiting for ingresscontroller %v", icName)
if err := waitForIngressControllerCondition(t, kclient, 5*time.Minute, icName, conditions...); err != nil {
t.Logf("waiting for ingresscontroller %v", icName)
if err := waitForIngressControllerCondition(t, kclient, 5*time.Minute, icName, availableConditionsForPrivateIngressController...); err != nil {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Raw: []byte(`{"loadBalancingAlgorithm":"source","dynamicConfigManager":"true","maxConnections":40000}`),
Raw: []byte(`{"loadBalancingAlgorithm":"source","dynamicConfigManager":"true"}`),
}
ic.Spec.TuningOptions.MaxConnections = 40000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestDesiredRouterDeploymentSpecAndNetwork feels like it should be at least two separate tests, but that can be a further cleanup for another day.

frobware added 4 commits May 9, 2022 11:54
$ go get github.com/openshift/api@1469fac35c7515f007526e51f519eef7339a1bbb
$ go mod vendor
$ go mod tidy
@frobware frobware force-pushed the haproxy-maxconn branch from 6620e18 to 2c8f12e Compare May 9, 2022 10:57
@frobware
Copy link
Contributor Author

frobware commented May 9, 2022

@Miciah I addressed your feedback with my latest push.

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 9, 2022
@frobware
Copy link
Contributor Author

frobware commented May 9, 2022

FAIL: TestHTTPCookieCapture

/test e2e-aws-operator

@frobware
Copy link
Contributor Author

frobware commented May 9, 2022

/test e2e-upgrade

@Miciah
Copy link
Contributor

Miciah commented May 9, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 9, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 9, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: frobware, Miciah

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@frobware
Copy link
Contributor Author

frobware commented May 9, 2022

/skip

@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 9, 2022

@frobware: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-single-node 2c8f12e link false /test e2e-aws-single-node

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit 972f09b into openshift:master May 9, 2022
@frobware frobware deleted the haproxy-maxconn branch September 5, 2022 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. docs-approved Signifies that Docs has signed off on this PR lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants