VMware provides an implementation of the open source HAProxy load balancer that you can use in your vSphere IaaS control plane environment. If you are using vSphere Distributed Switch (vDS) networking for Workload Management, you can install and configure the HAProxy load balancer.
Create a vSphere Distributed Switch for a Supervisor for Use with HAProxy Load Balancer
To configure a vSphere cluster as a Supervisor that uses the vSphere networking stack and the HAProxy load balancer, you must add the hosts to a vSphere Distributed Switch. You must create port groups on the distributed switch that you configure as Workload Networks to the Supervisor.
Prerequisites
- Review the system requirements for using vSphere networking for the Supervisor with the HAProxy load balancer. See Requirements for Enabling a Three-Zone Supervisor with HA Proxy Load Balancer and Requirements for Enabling a Single-Cluster Supervisor with VDS Networking and HAProxy Load Balancer vSphere IaaS Control Plane Concepts and Planning.
- Determine the topology for setting up Workload Networks with HAProxy on the Supervisor. See Topologies for Deploying the HAProxy Load Balancer in vSphere IaaS Control Plane Concepts and Planning.
Procedure
Results
The hosts are added to the distributed switch. You can now use the port groups that you created on the switch as Workload Networks of the Supervisor.
Deploy the HAProxy Load Balancer Control Plane VM
If you want to use the vSphere networking stack for Kubernetes workloads, install the HAProxy control plane VM to provide load balancing services to TKG clusters.
Prerequisites
- Verify that your environment meets the compute and networking requirements for deploying HA Proxy. See Requirements for Enabling a Three-Zone Supervisor with HA Proxy Load Balancer and Requirements for Enabling a Single-Cluster Supervisor with VDS Networking and HAProxy Load Balancer vSphere IaaS Control Plane Concepts and Planning.
- Verify that you have a Management network on a vSphere standard or distributed switch where to deploy the HAProxy load balancer. The Supervisor communicates with the HAProxy load balancer on that Management network.
- Create a vSphere Distributed Switch and port groups for Workload Networks. The HAProxy load balancer communicates with Supervisor and TKG cluster nodes over the Workload Networks. See Create a vSphere Distributed Switch for a Supervisor for Use with HAProxy Load Balancer. For information on Workload Networks, see Workload Networks on the Supervisor Cluster in vSphere IaaS Control Plane Concepts and Planning.
- Download the latest version of the VMware HAProxy OVA file from the VMware-HAProxy site.
- Select a topology for deploying the HAProxy load balancer and Workload Networks on the Supervisor. See Topologies for Deploying the HAProxy Load Balancer in vSphere IaaS Control Plane Concepts and Planning.
It may be helpful to view a demonstration of how to use vSphere IaaS control plane with vDS networking and HAProxy. Check out the video Getting Started Using vSphere with Tanzu.
Procedure
What to do next
Customize the HAProxy Load Balancer
Customize the HAProxy control plane VM, including configuration settings, network settings, and load balancing settings.
Appliance Configuration Settings
Parameter | Description | Remark or Example |
---|---|---|
Root Password | Initial password for the root user (6-128 characters). | Subsequent changes of password must be performed in operating system. |
Permit Root Login | Option to allow the root user to login to the VM remotely over SSH. |
Root login might be needed for troubleshooting, but keep in mind the security implications of allowing it. |
TLS Certificate Authority (ca.crt) | To use the self-signed CA certificate, leave this field empty. To use your own CA certificate (ca.crt), paste its contents into this field. You might need to Base64-encode the contents. https://www.base64encode.org/ |
If you are using the self-signed CA certificate, the public and private keys will be generated from the certificate. |
Key (ca.key) | If you are using the self-signed certificate, leave this field empty. If you provided a CA certificate, paste the contents of the certificate private key in this field. |
Network Configuration
Parameter | Description | Remark or Example |
---|---|---|
Host Name | The host name (or FQDN) to assign to the HAProxy control plane VM | Default value: haproxy.local |
DNS | A comma-separated list of DNS server IP addresses. | Default values: Example value: |
Management IP | The static IP address of the HAProxy control plane VM on the Management network. |
A valid IPv4 address with the prefix length of the network, for example: |
Management Gateway | The IP address of the gateway for the Management network. |
For example: |
Workload IP | The static IP address of the HAProxy control plane VM on the Workload network. This IP address must be outside of the load balancer IP address range. |
A valid IPv4 address with the prefix length of the network, for example: |
Workload Gateway | The IP address of the gateway for the Workload network. |
For example: If you select Frontend configuration, you must enter a gateway. The deployment will not be successful if Frontend is selected and no gateway is specified. |
Frontend IP | The static IP address of the HAProxy appliance on the Frontend network. This value is only used when the Frontend deployment model is selected. |
A valid IPv4 address with the prefix length of the network, for example: |
Frontend Gateway | The IP address of the gateway for the Frontend network. This value is only used when the Frontend deployment model is selected. |
For example: |
Load Balancing Settings
Parameter | Description | Example or Remark |
---|---|---|
Load Balancer IP Range(s) | In this field you specify a range of IPv4 addresses using CIDR format. The value must be a valid CIDR range or the installation will fail. HAProxy reserves the IP addresses for virtual IPs (VIPs). Once assigned, each VIP address is allocated and HAProxy replies to requests on that address.
The CIDR range you specify here must not overlap with the IPs you assign for the Virtual Servers when you enable
Workload Management in the
vCenter Server using the vSphere Client.
Note: The load balancer IP range must reside on a different subnet than the Management network. It's not supported to have the load balancer IP range on the same subnet as the Management network.
|
For example, the network CIDR For example, the network CIDR |
Dataplane API Management Port | The port on the HAProxy VM on which the load balancer's API service listens. |
A valid port. Port 22 is reserved for SSH. The default value is |
HAProxy User ID | Load balancer API user name |
The username clients use to authenticate to the load balancer's API service.
Note: You need this username when you enable the
Supervisor.
|
HAProxy Password | Load balancer API password |
The password clients use to authenticate to the load balancer's API service.
Note: You need this password when you enable the
Supervisor.
|