Skip to content

Commit

Permalink
Merge pull request #79 from backguynn/main
Browse files Browse the repository at this point in the history
support external loxilb & in-cluster pod peering
  • Loading branch information
TrekkieCoder authored Dec 4, 2023
2 parents 0b48762 + 43a69f0 commit 2937b5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions cmd/loxilb-agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ func run(o *Options) error {
if len(networkConfig.LoxilbURLs) <= 0 {
lbManager.DiscoverLoxiLBServices(loxiLBLiveCh, loxiLBPurgeCh)
}
lbManager.DiscoverLoxiLBPeerServices(loxiLBLiveCh, loxiLBPurgeCh)

if networkConfig.SetRoles != "" {
lbManager.SelectLoxiLBRoles(true, loxiLBSelMasterEvent)
Expand Down
8 changes: 5 additions & 3 deletions pkg/agent/manager/loadbalancer/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1291,9 +1291,11 @@ func (m *Manager) DiscoverLoxiLBServices(loxiLBAliveCh chan *api.LoxiClient, lox
}
}
m.LoxiClients = tmp
}

func (m *Manager) DiscoverLoxiLBPeerServices(loxiLBAliveCh chan *api.LoxiClient, loxiLBPurgeCh chan *api.LoxiClient) {
var tmploxilbPeerClients []*api.LoxiClient
ips, err = k8s.GetServiceEndPoints(m.kubeClient, "loxilb-peer-service", "kube-system")
ips, err := k8s.GetServiceEndPoints(m.kubeClient, "loxilb-peer-service", "kube-system")
klog.Infof("loxilb-peer-service end-points: %v", ips)
if err != nil {
ips = []net.IP{}
Expand Down Expand Up @@ -1500,9 +1502,9 @@ loop:
}(&bgpGlobalCfg)

if err == nil {
klog.Infof("set-bgp-global success")
klog.Infof("loxilb(%s) set-bgp-global success", aliveClient.Host)
} else {
klog.Infof("set-bgp-global failed(%s)", err)
klog.Infof("loxilb(%s) set-bgp-global failed(%s)", aliveClient.Host, err)
m.checkHandleBGPCfgErrors(loxiAliveCh, aliveClient, err)
}

Expand Down

0 comments on commit 2937b5d

Please sign in to comment.