Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Available scope: Network, Vpc, LoadBalancerRule
  2. Available APIs to create/delete/update/list load balancer configs. A new API replaceLoadBalancerConfigs will be added to replace all current LB configs with passed configs.
  3. When create/update/delet/replace lb configs, cloudstack will re-apply new load balancer configs
    1. generate new haproxy.cfg , based on our changes
    2. apply new haproxy.cfg in VRs.
    3. When VR is rebooted/recreated, the haproxy.cfg is also created based on our configs.
  4. For advanced features, more changes are needed
    1. Transparent LB. Beside the new haproxy.cfg, it will add some firewall rules in VRs.
    2. SSL offloading, it requires some changes on UI, and copied the SSL certificate to VRs.

API Changes

API nameAPI descriptionAPI ParametersAPI response
createLoadBalancerConfigCreates a load balancer config

scope (Network/Vpc/LoadBalancer)

networkId

vpcId

loadBalancerId

name (of config)

value (of config)

forced (Force add a load balancer config)

id (the load balancer rule ID)

name (the name of the load balancer config)

value (the value of the load balancer config)

scope (the scope of the load balancer config)

networkId

vpcId

loadBalancerId

created (the date when the load balancer config is created)

description (the description of the load balancer config)

defaultValue (the default value of the load balancer config)

deleteLoadBalancerConfigDeletes a load balancer configid of load balancer configSuccess/Exceptions
updateLoadBalancerConfigUpdates a load balancer configid of load balancer configSuccess/Exceptions

replaceLoadBalancerConfigs


Replaces load balancer configs of vpc/network/rule

scope (Network/Vpc/LoadBalancer)

networkId

vpcId

loadBalancerId

config (configs list, Example: config[0].name=timout&config[0].value=60000)

Success/Exceptions
listLoadBalancerConfigsList load balancer configs

id of load balancer config

scope (Network/Vpc/LoadBalancer)

networkId

vpcId

loadBalancerId

name (of config)

listAll (If set to true, list all available configs for the scope)

List of LoadBalancerConfigResponse


Load balancer configurations (to be supported)

  • Network


Scopenamevalue typecurrent value in CSdescription
Networkhaproxy.timeoutLong50000mstimeout server/client
Networkhaproxy.stats.enableBooleantrueIf haproxy stats is enabled
Networkhaproxy.stats.uriString/admin?statsURI of HAProxy stats
Networkhaproxy.stats.authStringadmin1:AdMiN123HAproxy stats username and password
Networkhaproxy.maxconnLong4096
Networkhaproxy.maxpipesLong1024default is maxconn/4 in haproxy


  • VPC (same as Network)


  • LoadBalancerRule

Scopenamevalue typecurrent value in CSdescription

LoadBalancerRule

lb.max.connLong<not set>LB max connection
LoadBalancerRulelb.full.connLong<not set>LB full connection, default is 'maxconn/10' in haproxy

LoadBalancerRule

lb.max.conn.eachLong<not set>LB max connection per site
LoadBalancerRulelb.full.conn.eachLong<not set>LB full connection per site
LoadBalancerRulelb.max.queue.eachLong<not set>LB max queue per site
LoadBalancerRulelb.httpBoolean<not set>If LB is http, default is 'true' for port 80 and 'false' for others'
LoadBalancerRulelb.http.keepaliveBooleanfalseIf LB http keepalive enabled/disabled


  • Advanced configurations

Scopenamevalue typecurrent value in CSdescription
Networkhaproxy.transparentBoolean<not set>If transparent is supported, default value is false
LoadBalancerRulelb.transparentBoolean<not set>If LB if transparent, only applies when haproxy.transparent is true. default value is false
LoadBalancerRulelb.ssl.offloadingBoolean<not set>If SSL offloading is enabled on the IP/port. default value is false
LoadBalancerRulelb.http2Boolean<not set>If HTTP2 is enabled. default value is false
LoadBalancerRulelb.ssl.configurationString<not set>Customized SSL configuration. available values are none (default), old, intermediate


DB Changes

A new table load_balancer_config is added to cloudstack, to save lb configs in network/vpc/loadbalancerrule.

Image RemovedImage Added

UI  changes


  1. Add a new tab 'LB Configs" in network view. Click on Network -> 'LB Configs', an overview of all the available settings are shown in a form;
    Image RemovedImage Added

  2. Add a new column in Load balancer rule view. Click 'Network' -> choose a network -> 'View IP Addresses' -> choose an IP -> click 'Configurations' tab -> click 'Load Balancing' -> click 'View All'
    Image RemovedImage Added

  3. Click 'Configure', a new dialog will be popup.
    Image RemovedImage Added

References

  1. Load Balancer rules http://docs.cloudstack.apache.org/en/latest/adminguide/networking_and_traffic.html#load-balancer-rules
  2. haproxy configurations. http://cbonte.github.io/haproxy-dconv/1.8/configuration.html
  3. SSL configurations. https://ssl-config.mozilla.org/#server=haproxy&version=1.8&config=intermediate&openssl=1.1.1d&guideline=5.4
  4. Leaseweb implementation for CloudStack 4.7.1. https://kb.leaseweb.com/products/apache-cloudstack-private-cloud/managing-apache-cloudstack-network#ManagingApacheCloudStackNetwork-ConfiguringaloadbalancerforanIPAddressofanIsolatedNetwork