Sign inSign up

cloudresty/nautiluslb

By cloudresty

•Updated about 1 year ago

NautilusLB is a lightweight, dynamic TCP load balancer for Kubernetes

Image
Networking
Web servers
1

866

cloudresty/nautiluslb repository overview

⁠NautilusLB

Go Tests GitHub Tag License

NautilusLB is an open-source Layer 4 (TCP) load balancer designed for high availability and scalability in Kubernetes environments. It intelligently distributes incoming TCP traffic across multiple backend servers based on Kubernetes service definitions and custom annotations.

Unlike traditional cloud load balancers, NautilusLB implements a reverse discovery pattern. Instead of services exposing themselves externally, NautilusLB actively discovers services from within the Kubernetes cluster and presents them externally. This leads to significant advantages in efficiency, security, and cost.

 


 

⁠Key Features

  • Dynamic Service Discovery: Automatically discovers and tracks Kubernetes services annotated with nautiluslb.cloudresty.io/enabled: "true".
  • Layer 4 Load Balancing: Provides efficient TCP-level load balancing for high-throughput, low-latency performance.
  • Health Checking: Continuously monitors backend health and automatically removes unhealthy servers from the load balancing pool.
  • Namespace Support: Allows targeted discovery of services within specific Kubernetes namespaces.
  • Cloud Agnostic: Works across any Kubernetes environment without cloud provider lock-in.
  • Resource Efficient: Eliminates the need for multiple cloud load balancer instances, reducing infrastructure costs and complexity.

 


 

⁠How to Run

The following example demonstrates how to run NautilusLB using a Docker container.

Prerequisites:

  • You must have a config.yaml file available.
  • If running outside a Kubernetes cluster, you must also mount your kubeconfig file.
docker run --detach \
  --name nautiluslb \
  --hostname nautiluslb \
  # Mount your configuration file
  --volume /path/to/your/config.yaml:/nautiluslb/config.yaml \
  # Mount your kubeconfig
  --volume /path/to/your/kubeconfig:/root/.kube/config \
  --restart unless-stopped \
  # Publish the ports you defined in your config.yaml
  --publish 80:80 \
  --publish 443:443 \
  cloudresty/nautiluslb:latest

Note: For production deployments, it is highly recommended to use a specific version tag instead of latest.

 


 

⁠Configuration

NautilusLB is configured using a YAML file named config.yaml. This file defines which ports to listen on and which backend Kubernetes services to target.

 

Example config.yaml:

configurations:
  - name: http_traffic_configuration
    listenerAddress: ":80"
    backendPortName: "http"

  - name: https_traffic_configuration
    listenerAddress: ":443"
    backendPortName: "https"

  - name: mongodb_internal_service
    listenerAddress: ":27017"
    backendPortName: "mongodb"
    namespace: "development"

For a full list of parameters, please see the configuration section on GitHub⁠.

 


 

⁠Kubernetes Integration

NautilusLB discovers services that are marked for load balancing using a specific annotation: nautiluslb.cloudresty.io/enabled: "true".

Simply add this annotation to any Kubernetes service you want NautilusLB to manage.

 

Example NGINX Service:

apiVersion: v1
kind: Service
metadata:
  name: ingress-nginx-controller
  namespace: ingress-nginx
  annotations:
    nautiluslb.cloudresty.io/enabled: 'true'
spec:
  ports:
    - name: http
      port: 80
    - name: https
      port: 443
  selector:
    app.kubernetes.io/name: ingress-nginx
  type: NodePort

 


 

⁠Find Out More

 


 

An open source project brought to you by the Cloudresty⁠ team.

Website⁠  |  LinkedIn⁠  |  BlueSky⁠  |  GitHub⁠  |  Docker Hub⁠

 

Tag summary

Content type

Image

Digest

sha256:961e9497e…

Size

49.9 MB

Last updated

about 1 year ago

docker pull cloudresty/nautiluslb