Vippy - A Virtual IP/BGP/IPVS Load-Balancer for Equinix Metal

Vippy - A Virtual IP/BGP/IPVS Load-Balancer for Equinix Metal

If I figure out how to make it work..

How it works!

The Vippy LB PoC uses BGP/IPVS and Equinix Metal EIPs to create a load-balancer service.

Requirements

A Machine will need to be created inside of Equinix Metal to host, vippy (you'll also need the various IDs for the Facility/project and an AUTH token.

Architecture

The EM Machine that is running Vippy will create an API endpoint on port 10001 that is used to create load-balancers. When we create a new loadBalancer with the API, vippy will use the EM API to request a public IP address and it will then use BGP to advertise that address to the ToR switches. At this point our loadbalancer address will be public and we should be able to hit it with a ping. We can now use the API to add backend server:port to this load-balancer instance at this point we will use IPVS to create a NAT based round-robin load-balancer instance.

Set the environment

export FACILITY_ID=""
export PACKET_AUTH_TOKEN=""
export PROJECT_ID=""

Start VIPPY

state: transport: INFO[0010] conf: state: transport: ">
$ sudo -E ./vippy 
INFO[0000] Starting Equinix Metal - Vippy LoadBalancer  
INFO[0000] Creating Equinix Metal Client                
INFO[0000] Creating BGP                                 
INFO[0002] Querying BGP settings for [am6-c3.small.x86-01] 
INFO[0003] Add a peer configuration for:169.254.255.1    Topic=Peer
INFO[0003] Add a peer configuration for:169.254.255.2    Topic=Peer
INFO[0003] API Server is now listening on :10001        
INFO[0010] Peer Up                                       Key=169.254.255.1 State=BGP_FSM_OPENCONFIRM Topic=Peer
INFO[0010] Peer Up                                       Key=169.254.255.2 State=BGP_FSM_OPENCONFIRM Topic=Peer
INFO[0010] conf:
        
          state:
         
           transport:
          
             
INFO[0010] conf:
           
             state:
            
              transport:
              
             
            
           
          
         
        

We can see above that Vippy has started, and has connected to the ToR switches in the facility ready to advertise our first load-balancer!

Create a load-balancer

curl -X POST http:// :10001/loadbalancer -H 'Content-Type: application/json' -d '{"name":"test loadbalancer", "port": 6443}'

We can view this new loadbalancer through the API or on the cli where vippy is running!

curl -s http://
   
    :10001/loadbalancers | jq
[
  {
    "uuid": "087fcb0f-8e07-4123-a32f-e8e83a281023",
    "name": "test loadbalancer",
    "eip": "147.75.84.41",
    "port": 6443,
    "backends": null
  }
]

   

Add a backend

We can use the API to add a backend service to our load-balancer instance!

curl -X POST http:// :10001/loadbalancer/087fcb0f-8e07-4123-a32f-e8e83a281023/backend -d '{"ip":"10.80.96.25", "port": 6443}'

curl -s http://
   
    :10001/loadbalancers | jq
[
  {
    "uuid": "087fcb0f-8e07-4123-a32f-e8e83a281023",
    "name": "test loadbalancer",
    "eip": "145.40.96.223",
    "port": 6443,
    "backends": [
      {
        "uuid": "779344ce-72ca-4aec-a1c0-d9c5c4d72419",
        "ip": "10.80.96.25",
        "port": 6443
      }
    ]
  }
]

   

View load-balancer in ipvs

On our vippy node we can inspect in more detail our load-balancer setup

ipvsadm -ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  145.40.96.223:6443 rr
  -> 10.80.96.25:6443             Masq    1      0          0

Delete a load-balancer

The following API call will delete the EIP, stop bgp and remove the IPVS service.

curl -X DELETE http://
   
    :10001/loadbalancer/087fcb0f-8e07-4123-a32f-e8e83a281023

   
Owner
Similar Resources

Basic Load Balancer

Basic Load Balancer

Load Balancer Work flow based on code snippet Trade-offs: 1. Using etcd as a global variable map. 2. Using etcd to store request references rather tha

Nov 1, 2021

A Load-balancer made from steel

A Load-balancer made from steel

slb The Steel Load Balancer A load-balancer forged in the fires of Sheffield Getting slb Prebuilt binaries for armv7 and amd64 exist in the releases p

Nov 13, 2022

Lightweight http response time based load balancer written in Go

HTTP Load Balancer Specifications http servers should always return time taken to proceed request in headers as EXECUTION_TIME in ms this load balance

Feb 22, 2022

High-performance PHP application server, load-balancer and process manager written in Golang

High-performance PHP application server, load-balancer and process manager written in Golang

RoadRunner is an open-source (MIT licensed) high-performance PHP application server, load balancer, and process manager. It supports running as a serv

Dec 9, 2021

A Service Load Balancer for Kubernetes.

PureLB - is a Service Load Balancer for Kubernetes PureLB is a load-balancer orchestrator for Kubernetes clusters. It uses standard Linux networking a

Dec 24, 2022

Consistelancer - Consistent hashing load balancer for Kubernetes

Setup minikube start kubectl apply -f k8s-env.yaml skaffold dev # test locks ku

Sep 28, 2022

Simple load-balancer for npchat servers, based on the xor distance metric between node & user id

npchat-helmsman Simple load-balancer for npchat servers, based on the xor distance metric between node & user id. Local Development Clone this reposit

Jan 15, 2022

Seesaw v2 is a Linux Virtual Server (LVS) based load balancing platform.

Seesaw v2 Note: This is not an official Google product. About Seesaw v2 is a Linux Virtual Server (LVS) based load balancing platform. It is capable o

Jan 3, 2023

Netmaker is a tool for creating and managing virtual networks

Netmaker is a tool for creating and managing virtual networks

Netmaker is a tool for creating and managing virtual networks. The goal is to make virtual/overlay/mesh networking easy for non-networking people. It should be like clicking a button. Netmaker consists of a server, an agent, and a UI.

Jan 2, 2023
Related tags
Kiwi-balancer - A balancer is a gateway between the clients and the server

Task description Imagine a standard client-server relationship, only in our case

Feb 11, 2022
Health check for instances behaind the ipvs

ipvshc Health check for instances behaind the ipvs Futures: Health check instances (curl from srcip) Change state (ipvsadm) Config in sql (sqlite) Sta

Nov 4, 2021
BGP implemented in the Go Programming Language

GoBGP: BGP implementation in Go GoBGP is an open source BGP implementation designed from scratch for modern environment and implemented in a modern pr

Dec 31, 2022
A modern layer 7 load balancer from baidu

BFE BFE is a modern layer 7 load balancer from baidu. Advantages Multiple protocols supported, including HTTP, HTTPS, SPDY, HTTP2, WebSocket, TLS, Fas

Dec 30, 2022
High-performance PHP application server, load-balancer and process manager written in Golang
High-performance PHP application server, load-balancer and process manager written in Golang

RoadRunner is an open-source (MIT licensed) high-performance PHP application server, load balancer, and process manager. It supports running as a serv

Jan 1, 2023
A load balancer supporting multiple LB strategies written in Go
A load balancer supporting multiple LB strategies written in Go

farely A load balancer supporting multiple LB strategies written in Go. Goal The goal of this project is purley educational, I started it as a brainst

Dec 21, 2022
gobetween - modern & minimalistic load balancer and reverse-proxy for the ☁️ Cloud era.
gobetween - modern & minimalistic load balancer and reverse-proxy for the ☁️ Cloud era.

gobetween - modern & minimalistic load balancer and reverse-proxy for the ☁️ Cloud era. Current status: Maintenance mode, accepting PRs. Currently in

Dec 25, 2022
KgLb - L4 Load Balancer
KgLb - L4 Load Balancer

KgLb KgLb is L4 a load balancer built on top of linux ip virtual server (ip_vs). It provides rich functionality such as discovery, health checks for r

Dec 16, 2022
Simple Reverse Proxy Load Balancer

lb - a reverse proxy load-balancing server, It implements the Weighted Round Robin Balancing algorithm

Mar 23, 2022
A distributed Layer 2 Direct Server Return (L2DSR) load balancer for Linux using XDP/eBPF

VC5 A distributed Layer 2 Direct Server Return (L2DSR) load balancer for Linux using XDP/eBPF This is very much a proof of concept at this stage - mos

Dec 22, 2022