A Service Load Balancer for Kubernetes.

Related tags

Network purelb
Overview

PureLB - is a Service Load Balancer for Kubernetes

PureLB is a load-balancer orchestrator for Kubernetes clusters. It uses standard Linux networking and routing protocols, and works with the operating system to announce service addresses.

Documentation

https://purelb.gitlab.io/docs

Quick Start

Installation is easy. For production systems we recommend installing using either Helm or a CI-built manifest file. These approaches use versioned image tags so they are stable. Instructions are on our install page at https://purelb.gitlab.io/docs/install/ .

For development, you can install PureLB from the source tree. This isn't recommended for production because it will install PureLB using an unstable image tag that changes over time so you could have unintended upgrades.

  1. Deploy the PureLB components
    kustomize build deployments/samples | kubectl apply -f -
    Now you can configure PureLB. PureLB's default node agent configuration usually "just works" so we loaded it above. PureLB's allocator manages IP addresses so it needs a configuration that matches the network on which it's running. The allocator is configured using "Service Group" resources which contain pools of IP addresses and their associated network configuration. The node agent configures the Linux OS to advertise them. The easiest way to get started is to create a Service Group that uses the same IPNET as the host interface, PureLB will add the allocated addresses to the same network interface.
  2. Copy the default service group config to your custom version
    cp configs/default-servicegroup.yaml configs/my-servicegroup.yaml
  3. Edit configs/my-servicegroup.yaml so the subnet and pool are appropriate for your network
  4. Load your service group config
    kubectl apply -f configs/my-servicegroup.yaml

To test PureLB you can deploy a simple "echo" web application:

kubectl create deployment echoserver --image=k8s.gcr.io/echoserver:1.10

...and then expose the deployment using a LoadBalancer service:

kubectl expose deployment echoserver --name=echoserver-service --port=80 --target-port=8080 --type=LoadBalancer

The PureLB allocator will allocate an address and assign it to the service. The PureLB node agents then configure the underlying operating system to advertise the address.

Building

Run make help for Makefile documentation.

If you fork this project and want to build ARM images you'll need to set up a Gitlab CI ARM "runner" process for your fork. I use a Raspberry Pi 4 Model B running Raspbian GNU/Linux 10 (Buster).

Find your project's registration token from the project CI Settings - https://gitlab.com/{your_gitlab_name}/purelb/-/settings/ci_cd . Expand the "Runners" section and look for "Set up a specific Runner manually".

Install the runner client program - https://docs.gitlab.com/runner/install/linux-repository.html

Run gitlab-runner register. It will ask for the url (https://gitlab.com/) and registration token.

Stop the runner (systemctl stop gitlab-runner.service) and make a few edits to the /etc/gitlab-runner/config.toml runner config file:

  • Set the privileged flag to true (it's false by default)
  • Add "/certs/client" to the volumes list
  • Increase wait_for_services_timeout to 300
  • If you're running a Pi4 with 4GB of memory or more you can set concurrent to 2 so the allocator and lbnodeagent will build simultaneously

Start the runner systemctl start gitlab-runner.service and verify that it's running systemctl status gitlab-runner.service.

Verify that the runner is listed on your project's CI Settings page.

Code

Credits

PureLB wouldn't have been possible without MetalLB so we owe a huge debt of gratitude to Dave Anderson for almost single-handedly making MetalLB happen. Thank you Dave!

You might also like...
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

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

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

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

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

Service that calls uzma24/project1 service, takes input from .txt file and prints JSON output returned from the service.

Service that calls uzma24/project1 service, takes input from .txt file and prints JSON output returned from the service. Program can take large input files.

A service registry and service discovery implemention for kitex based on etcd

kitex etcd Introduction kitexetcd is an implemention of service registry and service discovery for kitex based on etcd. Installation go get -u github.

A service to proxy requests to a given backend service.

Proxy Service A service to proxy requests to a given backend service. Go 1.17+ Clone git clone [email protected]:janu-cambrelen/proxy-service.git Run (L

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

Comments
  • fix: not allocating address from specified loadbalancerIP in ipv6

    fix: not allocating address from specified loadbalancerIP in ipv6

    If loadBalancerIP was specified for ipv4 service, the allocator correctly allocates the ip address if it is available in the given group. But for ipv6, it doesnt work. This is due to a bug in localpool.go contains method.

    func (p LocalPool) Contains(ip net.IP) bool {
    	if p.v4Range != nil {
    		return p.v4Range.Contains(ip)
    	}
    	if p.v6Range != nil {
    		return p.v6Range.Contains(ip)
    	}
    	return false
    }
    

    As per this code, if I have both ipv4range and ipv6range specified in the servicegroup, it just checks if the given ip is within v4range and returns the value. V6range is always ignored.

    Thee bug is fixed by ensuring that v4range is compared only if the given IP is ipv4

    Signed-off-by: Jayadeep KM [email protected]

    opened by kmjayadeep 1
Owner
PureLB
A Service Load Balancer for Kubernetes.
PureLB
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

Jozef Lami 0 Feb 11, 2022
Consistelancer - Consistent hashing load balancer for Kubernetes

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

null 2 Sep 28, 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

null 5.7k Dec 30, 2022
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

Spiral Scout 6.9k Jan 1, 2023
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

Mehdi Cheracher 15 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. Current status: Maintenance mode, accepting PRs. Currently in

Yaroslav Pogrebnyak 1.8k Dec 25, 2022
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

Dropbox 131 Dec 16, 2022
Simple Reverse Proxy Load Balancer

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

Blessing Pariola 3 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

David Coles 41 Dec 22, 2022
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

Nikhil Vasudev 0 Nov 1, 2021