Skip to content

Commit

Permalink
Merge pull request #16 from loxilb-io/persist
Browse files Browse the repository at this point in the history
PR - Added persist selection for end-points
  • Loading branch information
UltraInstinct14 committed Feb 3, 2024
2 parents 4ae7e25 + ca92515 commit f7f4b08
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/create/create_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ func SelectToNum(sel string) int {
ret = 1
case "priority":
ret = 2
case "persist":
ret = 3
default:
ret = 0
}
Expand All @@ -105,14 +107,15 @@ func NewCreateLoadBalancerCmd(restOptions *api.RESTOptions) *cobra.Command {
o := CreateLoadBalancerOptions{}

var createLbCmd = &cobra.Command{
Use: "lb IP [--select=<rr|hash|priority>] [--tcp=<port>:<targetPort>] [--udp=<port>:<targetPort>] [--sctp=<port>:<targetPort>] [--icmp] [--mark=<val>] [--secips=<ip>,][--endpoints=<ip>:<weight>,] [--mode=<onearm|fullnat>] [--bgp] [--monitor] [--inatimeout=<to>] [--name=<service-name>]",
Use: "lb IP [--select=<rr|hash|priority|persist>] [--tcp=<port>:<targetPort>] [--udp=<port>:<targetPort>] [--sctp=<port>:<targetPort>] [--icmp] [--mark=<val>] [--secips=<ip>,][--endpoints=<ip>:<weight>,] [--mode=<onearm|fullnat>] [--bgp] [--monitor] [--inatimeout=<to>] [--name=<service-name>]",
Short: "Create a LoadBalancer",
Long: `Create a LoadBalancer
--select value options
rr - select the lb end-points based on round-robin
hash - select the lb end-points based on hashing
priority - select the lb based on weighted round-robin
persist - select the lb end-point based on sender
--mode value options
onearm - LB put LB-IP as srcIP
fullnat - LB put Service IP as scrIP
Expand Down Expand Up @@ -239,7 +242,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")
createLbCmd.Flags().StringVarP(&o.Select, "select", "", "rr", "Select the hash algorithm for the load balance.(ex) rr, hash, priority, persist")
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

0 comments on commit f7f4b08

Please sign in to comment.