Skip to main content

A controller to auto configure k8s load balancer on premise

Project description

# What’s that thing?

lb-controller is kubernetes operator that can handle dynamic reconfiguration of an external load balancer, e.g haproxy, it aims to allow the use of the LoadBalancer or NodePort service type with on premise clusters.

This operator is not deployed in the K8s cluster but on the load balancers and is a subscriber of the cluster events to know when it has to wake up and do its thing.

We thought of 3 scenarios while building this app:

  • HAProxy + keepalived

  • Envoy + keepalived

  • keepalived only

The advantage of this implementation compared to [MetalLB](https://metallb.universe.tf/) is that you gain the ability to completely master the LB configuration, for example ipv6 to ipv4 or specific SSL configurations.

LB-controller doesn’t allocate IP addresses for LB. They must be specified:
  • for LoadBalancer services, using spec.loadBalancerIP field

  • for NodePort services, using an annotation nammed external-lb/ip-address

# How should I integrate lb-controller?

  • Install haproxy and keepalived

  • pip install lb-controller

  • add the configurations in /etc/lb-controller/

  • Define a dedicated service account to consume only the appropriate resources from the cluster API server

  • set this identity in the /root/.kube/config file on the HAProxy hosts.

You can find an ansible role at this address… as an example.

# Metrics

This app exposes two metrics in the openmetrics format to be scrape by prometheus for example: - number of valid managed services - number of invalid managed services

# Developers

In order to contribute to lb-controller, you should have Pipenv installed Install the virtualenv and all dependencies with pipenv install –dev, then run unit tests with pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lb_controller-0.0.9.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lb_controller-0.0.9-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file lb_controller-0.0.9.tar.gz.

File metadata

  • Download URL: lb_controller-0.0.9.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for lb_controller-0.0.9.tar.gz
Algorithm Hash digest
SHA256 98a2305eb8462eaef83675e63e765330db8ef4d5997142988fbfbb945fb7d45d
MD5 846040836c137f7f68e66e9a1645127e
BLAKE2b-256 be6790a7262fa1e0149dbeac9af401ef1a1449410b10168986222efd16d6e978

See more details on using hashes here.

File details

Details for the file lb_controller-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: lb_controller-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for lb_controller-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 cdb0ca5eb8504e9fa6ce963b6b4d9a1143af7741848a0fe49fb07a7f6e7b5fcc
MD5 ad79d7f665531f6d1e423cfe81db7206
BLAKE2b-256 9148682e250b569edb2f5725be6f421a38363d1e2fe0f655cdbf99140d08e115

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page