Forum Discussion

ajay1986's avatar
ajay1986
Icon for Nimbostratus rankNimbostratus
Nov 29, 2024

Nginx Plus LB as backend node member on F5 LTM

We have requirement for traffic load balancing  as mentioned in below scenario.

 

Main URL is configured on L5 LTM VIP , 80% traffic should go on Azure VM node , 20% should go on AKS via NGINX plus load balancer 

F5 LTM VIP -  abc.com  - 10.10.10.10

Pool member:

Node 1 - Azure VM - 10.10.20.5

Node 2 - Nginx Plus virtual server - abcaks.com - 10.10.30.5

 

 

 

 

  • Give this a try (assuming the port in your pool), make sure you select the LB algorithm to ratio (member):

    tmsh create ltm pool my_pool_name \
        members add { 10.10.20.5:443 { ratio 4 } 10.10.30.5:443 { ratio 1 } }
    

     

  • To configure F5 LTM for traffic load balancing with your specific requirements (80% traffic to Azure VM and 20% to AKS via Nginx Plus), you can use iRule or Traffic Segmentation based on weights in F5 LTM. Here’s a short configuration outline:

    1. Create Pool and Add Members:
      • Pool 1: Create a pool with two members:
        • Node 1: Azure VM (10.10.20.5)
        • Node 2: Nginx Plus virtual server (10.10.30.5)
    2. Assign Weights:
      • Set weight for Node 1 (Azure VM) to 80.
      • Set weight for Node 2 (Nginx Plus) to 20.
    3. VIP Configuration:
      • Configure F5 LTM VIP (10.10.10.10) with the relevant pool as the backend.
    4. Traffic Distribution:
      • F5 LTM will now distribute 80% of traffic to the Azure VM (Node 1) and 20% to Nginx Plus (Node 2) based on the weight configuration.

    This setup will ensure traffic is distributed according to the required percentages.

    • JRahm's avatar
      JRahm
      Icon for Admin rankAdmin

      Quick note on how 80% of connections is handled by the algorithm...if you set the ratio as 80/20 instead of 4/1, and your connections/sec never exceeds 20, the distribution will actually be far closer to round robin. This is because it IS round robin until the lower percentage threshold on a node/member (depending on algorithm selection of node or member) is reached. By setting it to 4/1 (still 80/20 by math) you assure that regardless of traffic load you'll still be reaching your ratio goals.