Skip to content

Commit

Permalink
Merge pull request #20 from loxilb-io/lc-support
Browse files Browse the repository at this point in the history
PR - Least-connection mode support
  • Loading branch information
UltraInstinct14 committed Mar 4, 2024
2 parents 70232b3 + 8d5442c commit c25b0c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/create/create_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ func SelectToNum(sel string) int {
ret = 2
case "persist":
ret = 3
case "lc":
ret = 4
default:
ret = 0
}
Expand Down Expand Up @@ -242,7 +244,7 @@ ex) loxicmd create lb 192.168.0.200 --tcp=80:32015 --endpoints=10.212.0.1:1,10.2
createLbCmd.Flags().BoolVarP(&o.BGP, "bgp", "", false, "Enable BGP in the load balancer")
createLbCmd.Flags().BoolVarP(&o.Monitor, "monitor", "", false, "Enable monitoring end-points of this rule")
createLbCmd.Flags().StringSliceVar(&o.SecIPs, "secips", o.SecIPs, "Secondary IPs for SCTP multihoming rule specified as '<secondaryIP>'")
createLbCmd.Flags().StringVarP(&o.Select, "select", "", "rr", "Select the hash algorithm for the load balance.(ex) rr, hash, priority, persist")
createLbCmd.Flags().StringVarP(&o.Select, "select", "", "rr", "Select the hash algorithm for the load balance.(ex) rr, hash, priority, persist, lc")
createLbCmd.Flags().Uint32VarP(&o.Timeout, "inatimeout", "", 0, "Specify the timeout (in seconds) after which a LB session will be reset for inactivity")
createLbCmd.Flags().Uint16VarP(&o.Mark, "mark", "", 0, "Specify the mark num to segregate a load-balancer VIP service")
createLbCmd.Flags().StringSliceVar(&o.Endpoints, "endpoints", o.Endpoints, "Endpoints is pairs that can be specified as '<endpointIP>:<Weight>'")
Expand Down
2 changes: 2 additions & 0 deletions cmd/get/get_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ func NumToSelect(sel int) string {
ret = "priority"
case 3:
ret = "persist"
case 4:
ret = "lc"
default:
ret = "rr"
}
Expand Down

0 comments on commit c25b0c5

Please sign in to comment.