KgLb - L4 Load Balancer

KgLb Build Test Lint

KgLb is L4 a load balancer built on top of linux ip virtual server (ip_vs).

KgLb image

It provides rich functionality such as discovery, health checks for real servers, automatically update their weights based on status, and apply all required changes to make ipvs alive including registering virtual services, updating reals and adding required vip addresses.

Overview

KgLb consists of two key components called Control Plane and Data Plane. Both components are written as libraries and based on a few modules which follow predefined interfaces. Next picture shows high-level overview of KgLb internals. design

  • Control Plane is a library which discovers, health checks real servers, and generates data plane state:
    • Services is a library which creates set of Balancers according received configuration, generates data plane state and applies it via DataPlaneClient interface.
    • Balancer discovers, health checks and generate single or multiple BalancerState which represents single ipvs service. Balancer may generate extra fwmark states when health checking via fwmark is enabled.
    • StateGenerator generates complete Data Plane state based on ControlPlane config and generated Balancers.
    • DiscoveryFactory is an interface to create appropriate discovery instance based on configuration. Open version supports statis discovery method only (pre-defined set of hosts provided in config).
    • HealthCheckerFactory is an interface to create required health checking instance instane. Currently supported checks are: http including http proxy, tcp, dns, syslog.
    • DataPlaneClient provides communication interface with DataPlane. Current imlementation of DataPlaneClient in kglbd consists of simple API call of data plane, but it might provides grpc or rest bridge when control plane and data plane are separate services.
  • Data Plane is a library which represents middle layer between control pland and multiple system components, and makes system changes based on received data plane state. Today Data Plane can do following:
    • add/delete ip address.
    • interact with ip_vs module (ipvs service creation/deletion + updating real servers).

Requirements

  • Go 1.13
  • Linux Kernel 4.4+
  • protoc 3.6.1+ and protoc-gen-go

Supported features

  • Discovery: static only.
  • Health Checkers: http, dns, syslog, tcp.
  • Tunneled health checking through fwmarks.
  • Stats exported in prometheus format and available on http://127.0.0.1:5678/stats by default.
  • Graceful shutdown.

Installation

# Compile protobufs
pushd ./proto
protoc --go_out=. ./dropbox/proto/kglb/healthchecker/healthchecker.proto
protoc --go_out=. ./dropbox/proto/kglb/*.proto
popd

# Compiling
go build -o kglbd.bin ./kglbd

Quick start

sudo ./kglbd.bin -config=./examples/example_config.json -logtostderr

Next Steps

  • Releasing bgp module.
  • Integration with Katran.
Similar Resources

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

Golang Super Simple Load Balance

SSLB (Super Simple Load Balancer) ver 0.1.0 It's a Super Simple Load Balancer, just a little project to achieve some kind of performance. Features Hig

Dec 18, 2022

Simple, fast and scalable golang rpc library for high load

gorpc Simple, fast and scalable golang RPC library for high load and microservices. Gorpc provides the following features useful for highly loaded pro

Dec 19, 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

Consul Load-Balancing made simple

Consul Load-Balancing made simple

Notes From release 1.5.15 onward, fabio changes the default GOGC from 800 back to the golang default of 100.

Dec 27, 2022
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
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
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
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
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 E

Mar 10, 2022
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