loxilb-io / loxilb

eBPF based cloud-native load-balancer for Kubernetes|Edge|Telco|IoT|XaaS.
https://www.loxilb.io
Apache License 2.0
1.36k stars 108 forks source link

Support LC distribution #481

Closed UltraInstinct14 closed 6 months ago

UltraInstinct14 commented 8 months ago

loxilb currently supports RR, WRR distribution but in many cases LC (least connections) become necessary.

TrekkieCoder commented 6 months ago

The initial support is added. To configure using loxicmd -

loxicmd create 20.20.20.1 --tcp=2020:8080 --endpoints=31.31.31.1:1,32.32.32.1:1,33.33.33.1:1 --select lc

To configure using kube-loxilb, use the following yaml -

apiVersion: v1
kind: Service
metadata:
  name: sctp-lb
  annotations:
    loxilb.io/lbmode: "fullnat"
    loxilb.io/epselect : "lc"
    spec:
  loadBalancerClass: loxilb.io/loxilb
  externalTrafficPolicy: Local
  selector:
    what: sctp-lb
  ports:
   - port: 56004
     protocol: SCTP
     targetPort: 9999
  type: LoadBalancer