Using Your Own Load Balancer

This guide describes how to use your own load balancer and forward traffic to your Pivotal Application Service (PAS) router IP address.

Pivotal Cloud Foundry (PCF) includes a tier of reverse proxies that dynamically track the location of application containers and system components, enabling routing of requests to those endpoints even as IPs and ports change.

In order for the PCF Routers to be horizontally scalable and highly available, a load balancer must be deployed in front of them. The simplest solution is to use a layer-4 TCP load balancer, provided by your IaaS or IT team, which passes all HTTP and TLS handling to the PCF Routers. For details on TLS termination, see Securing Traffic into Cloud Foundry. For a description of features supported by the PCF routing tier, see HTTP Routing.

If you have requirements that are not fulfilled by the PCF Routers alone, you can choose to use your own layer-7 load balancer (provided by your IaaS or IT team), or the HAProxy load balancer included with PCF. If you choose to use HAProxy, you must use a layer-4 TCP load balancer in front on it, in order for HAProxy itself to be highly available. Singleton instances of HAProxy are only for use in lab and test environments.

If you choose to use your own layer-7 load balancer, it must fulfill the following requirements:

  • Provides load balancing to each of the PCF Router IP addresses
  • Supports TLS termination for wildcard hostnames
  • Adds appropriate x-forwarded-for and x-forwarded-proto HTTP headers to incoming requests
  • (Optional) Supports WebSockets

The choice to use HAProxy or your own load balancer depends on what features you need out of a load balancer, and whether you want the ability to configure it yourself.

Note: Application logging with Loggregator requires WebSockets. To use another logging service, see the Using Third-Party Log Management Services topic.

For how to install an F5 Local Traffic Manager (LTM) as a load balancer for PCF and Pivotal Application Service (PAS), see Configuring an F5 Load Balancer for PAS.

Prerequisites

To integrate your own load balancer with PCF, you must ensure the following:

  • WebSocket connections are not blocked for Loggregator functionality.
  • The load balancer must be able to reach the Gorouter IP addresses.

Follow the instructions below to use your own load balancer.

Step 1: Deploy PCF Installation VM

Deploy a PCF Installation virtual machine. See the topic Deploying Operations Manager to vSphere for more information.

Step 2: Register PCF IP Address

In your load balancer, register the IP addresses that you assigned to PCF.

Step 3: Configure Pivotal Ops Manager and BOSH Director

Configure your Pivotal Operations Manager and BOSH Director as described in Installing Pivotal Cloud Foundry, then add PAS.

Do not click Install after adding PAS.

Step 4: Configure Networking

Complete the Networking configuration page in PAS. Load balancer configuration in PAS varies depending on which IaaS you are using for PCF. See the configuration procedure for your deployment IaaS:

Step 5: Finalize Changes

  1. Return to the Ops Manager Installation Dashboard

  2. Click Install.

Create a pull request or raise an issue on the source for this page in GitHub