Skip to content

Commit

Permalink
add more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AshleyDumaine committed May 23, 2024
1 parent e43350d commit acebeba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cloud/linode/cilium_loadbalancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,10 @@ func (l *loadbalancers) ensureCiliumBGPPeeringPolicy(ctx context.Context) error
LocalASN: 65001,
ExportPodCIDR: ptr.To(true),
ServiceSelector: &slimv1.LabelSelector{
// By default, virtual routers will not announce any services.
// This selector makes it so all services within the cluster are announced.
// See https://docs.cilium.io/en/stable/network/bgp-control-plane/#service-announcements
// for more information.
MatchExpressions: []slimv1.LabelSelectorRequirement{{
Key: "somekey",
Operator: slimv1.LabelSelectorOpNotIn,
Expand All @@ -418,6 +422,7 @@ func (l *loadbalancers) ensureCiliumBGPPeeringPolicy(ctx context.Context) error
}},
},
}
// As in https://github.com/linode/lelastic, there are 4 peers per DC
for i := 1; i <= 4; i++ {
neighbor := v2alpha1.CiliumBGPNeighbor{
PeerAddress: fmt.Sprintf("2600:3c0f:%d:34::%d/64", regionID, i),
Expand Down
3 changes: 2 additions & 1 deletion cloud/linode/loadbalancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ func (l *loadbalancers) EnsureLoadBalancer(ctx context.Context, clusterName stri

// check for existing CiliumLoadBalancerIPPool for service
pool, err := l.getCiliumLBIPPool(ctx, service)
// if the CiliumLoadBalancerIPPool doesn't exist, it's not nil, just empty
// if the CiliumLoadBalancerIPPool doesn't exist, it's not nil, instead an empty struct
// gets returned, so we check if this is so via the Name being empty
if pool != nil && pool.Name != "" {
klog.Infof("Cilium LB IP pool %s for Service %s ensured", pool.Name, serviceNn)
// ingress will be set by Cilium
Expand Down

0 comments on commit acebeba

Please sign in to comment.