Skip to content

Commit

Permalink
Support for custom bgp listen port
Browse files Browse the repository at this point in the history
  • Loading branch information
TrekkieCoder committed Jul 30, 2023
1 parent 884a787 commit e7aab92
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/loxilb-agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func run(o *Options) error {
klog.Infof("LB Class: %s", o.config.LoxilbLoadBalancerClass)
klog.Infof("CIDR: %s", o.config.ExternalCIDR)
klog.Infof("SetBGP: %v", o.config.SetBGP)
klog.Infof("ListenBGPPort: %v", o.config.ListenBGPPort)
klog.Infof("SetLBMode: %v", o.config.SetLBMode)
klog.Infof("ExclIPAM: %v", o.config.ExclIPAM)
klog.Infof("Monitor: %v", o.config.Monitor)
Expand All @@ -86,6 +87,7 @@ func run(o *Options) error {
ExternalCIDR: o.config.ExternalCIDR,
ExternalCIDR6: o.config.ExternalCIDR6,
SetBGP: o.config.SetBGP,
ListenBGPPort: o.config.ListenBGPPort,

Check failure on line 90 in cmd/loxilb-agent/agent.go

View workflow job for this annotation

GitHub Actions / Run-Preflight

unknown field ListenBGPPort in struct literal of type "github.com/loxilb-io/kube-loxilb/pkg/agent/config".NetworkConfig
SetRoles: o.config.SetRoles,
ExtBGPPeers: o.config.ExtBGPPeers,
SetLBMode: o.config.SetLBMode,
Expand Down
2 changes: 2 additions & 0 deletions cmd/loxilb-agent/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ type AgentConfig struct {
ExtBGPPeers []string `yaml:"extBGPPeers,omitempty"`
// support BGP protocol
SetBGP uint16 `yaml:"setBGP,omitempty,default=0"`
// Custom BGP Port
ListenBGPPort uint16 `yaml:"listenBGPPort,omitempty,default=179"`
// loxilb loadbalancer mode
SetLBMode uint16 `yaml:"setLBMode,omitempty"`
// Shared or exclusive IPAM
Expand Down
1 change: 1 addition & 0 deletions cmd/loxilb-agent/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func (o *Options) addFlags(fs *pflag.FlagSet) {
fs.StringVar(&secondaryCIDRs6, "externalSecondaryCIDRs6", secondaryCIDRs6, "External Secondary CIDR6 Range(s)")
fs.StringVar(&o.config.LoxilbLoadBalancerClass, "loxilbLoadBalancerClass", o.config.LoxilbLoadBalancerClass, "Load-Balancer Class Name")
fs.Uint16Var(&o.config.SetBGP, "setBGP", o.config.SetBGP, "Use BGP routing")
fs.Uint16Var(&o.config.ListenBGPPort, "listenBGPPort", o.config.ListenBGPPort, "Custom BGP listen port")
fs.StringVar(&extBGPPeers, "extBGPPeers", extBGPPeers, "External BGP Peer(s)")
fs.BoolVar(&o.config.ExclIPAM, "setUniqueIP", o.config.ExclIPAM, "Use unique IPAM per service")
fs.Uint16Var(&o.config.SetLBMode, "setLBMode", o.config.SetLBMode, "LB mode to use")
Expand Down

0 comments on commit e7aab92

Please sign in to comment.