Installing and Configuring the HAProxy Load Balancer
You can use the vSphere Automation APIs to customize the HAProxy control plane VM after you install the HAProxy in your vSphere with Tanzu environment.
If you use the vSphere networking stack in your vSphere with Tanzu environment, you need to supply your own load balancer. You can use the open source implementation of the HAProxy load balancer that VMware provides.
For more information about the prerequisites for installation and the deployment procedure through the vSphere Client, see the documentation.
You can use the vSphere Automation REST APIs to install and configure the HAProxy load balancer. You can download the latest version of the HAProxy OVA file from the VMware-HAProxy site to a content library item. For more information about how to achieve this task, see Upload an OVF Package from a Local File System to a Library Item. Then you can create a new VM from the OVA template in the content library as described in Deploy a Virtual Machine or vApp from an OVF Template in a Content Library.
PUT
https://<vcenter_ip_address_or_fqdn>/api/vcenter/namespace-management/clusters/<cluster_id>/load-balancers/<loadbalancer_id>
request and submit a LoadBalancers.SetSpec JSON object in the
request body. You can define the following HAProxy load balancer settings within the
LoadBalancers.HAProxyConfigSetSpec data structure which is an
optional property of the LoadBalancers.SetSpec data structure.
Parameter | Description |
---|---|
servers setServers(List<LoadBalancersTypes.Server> servers) | A list of Servers that represent the endpoints for
configuring the HAProxy load balancers. Each endpoint is described by a load
balancer IP address and a Data Plane API management port. Each endpoint must be described with the port on the HAProxy VM on which the Data Plane API service listens. The Data Plane API service controls the HAProxy server and runs inside the HAProxy VM. The default port is 5556. Port 22 is reserved for SSH. |
username setUsername(String username) | The administrator user name that is configured with the HAProxy OVA file and is used to authenticate to the HAProxy Data Plane API server. |
password setPassword(char[] password) | The password for the administrator user name. |
certificate_authority_chain setCertificateAuthorityChain(String certificateAuthorityChain) | The certificate in PEM format that is signed or is a trusted root of the server certificate that the Data Plane API server presents. |