Skip to content
  • Miciah Masters's avatar
    Configure router to use Power of Two Random Choices · e83b057c
    Miciah Masters authored
    Configure router deployments to use HAProxy's "random" load balancing
    algorithm, which with its default parameters implements the "Power of Two
    Random Choices" balancing algorithm.  Allow the user to revert to the
    previous "Least Connections" balancing algorithm using an unsupported
    config override.
    
    See https://www.haproxy.com/blog/power-of-two-load-balancing/ for a
    description and analysis of Power of Two Random Choices.
    
    This commit resolves NE-551.
    
    https://issues.redhat.com/browse/NE-551
    
    * pkg/operator/controller/ingress/deployment.go
    (RouterLoadBalancingAlgorithmEnvName): New const.
    (desiredRouterDeployment): Check spec.unsupportedConfigOverrides, and set
    ROUTER_LOAD_BALANCE_ALGORITHM to "leastconn" if the
    {"loadBalancingAlgorithm":"leastconn"} override is set.
    * pkg/operator/controller/ingress/deployment_test.go
    (TestDesiredRouterDeployment): Verify that desiredRouterDeployment sets the
    ROUTER_LOAD_BALANCE_ALGORITHM environment variable as expected and
    correctly handles spec.unsupportedConfigOverrides.
    * test/e2e/operator_test.go
    (availableConditionsForPrivateIngressController): New variable.  Define the
    expected status conditions for an ingresscontroller that specifies the
    "Private" endpoint publishing strategy type and is available.
    (TestTLSSecurityProfile, TestRouteAdmissionPolicy, TestSyslogLogging)
    (TestContainerLogging, TestUniqueIdHeader): Use
    availableConditionsForPrivateIngressController.
    (TestLoadBalancingAlgorithmUnsupportedConfigOverride): New test.  Verify
    that the operator configures the router with the "random"
    load-balancing algorithm by default and allows the algorithm to be changed
    to "leastconn" algorithm using an unsupported config override.
    e83b057c