Calico fenced off via Tigera Installation CR (apps@2121892). flock-agent now renders bird.conf with the per-node BGP peers; bird sidecar reloads on changes (debounced 500ms). Re-render tick every 15s reacts to NodeConfig updates. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+23
-16
@@ -65,22 +65,29 @@ func (s *Server) configureRuntime(ctx context.Context) error {
|
|||||||
if err := bird.SummaryRoutes(nc); err != nil {
|
if err := bird.SummaryRoutes(nc); err != nil {
|
||||||
s.Logger.Warn("install summary routes", "err", err)
|
s.Logger.Warn("install summary routes", "err", err)
|
||||||
}
|
}
|
||||||
// BGP is intentionally NOT rendered on the first cutover.
|
// Calico is fenced off this node (Tigera Installation CR adds a
|
||||||
//
|
// nodeAffinity excluding flock.fritzlab.net/agent on
|
||||||
// Calico's calico-node DaemonSet still runs on this node (it's
|
// calicoNodeDaemonSet). flock now owns BGP from this host.
|
||||||
// Tigera-Operator-managed via ArgoCD with selfHeal=true) and Calico's
|
if err := bird.Render(nc, nil, nil, routerIDFromNodeIP(s.restCfg)); err != nil {
|
||||||
// bird is bound to BGP port 179 with the same ASN we'd advertise from.
|
s.Logger.Warn("initial bird render", "err", err)
|
||||||
// A clean coexistence requires either an Installation-CR change or a
|
}
|
||||||
// post-cutover Calico stop. Both are out of scope for the first M2
|
go func() {
|
||||||
// cutover. crt001 carries a static route for the flock /64 instead.
|
t := time.NewTicker(15 * time.Second)
|
||||||
//
|
defer t.Stop()
|
||||||
// To switch to live BGP later: replace this block with bird.Render(nc,
|
for {
|
||||||
// ...) + 15s tick re-render, after disabling calico-node on flock-
|
select {
|
||||||
// labeled nodes. The bird sidecar is already running with a bootstrap
|
case <-ctx.Done():
|
||||||
// config (just protocol kernel + device — no BGP), so flipping this on
|
return
|
||||||
// is a one-line change here.
|
case <-t.C:
|
||||||
s.Logger.Info("BIRD BGP disabled for first cutover; static route on crt001 carries flock /64",
|
cur := s.NodeConfig.Load()
|
||||||
"node_cidr6", nc.Spec.CIDR6, "node_cidr4", nc.Spec.CIDR4)
|
if cur == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
_ = bird.SummaryRoutes(cur)
|
||||||
|
_ = bird.Render(cur, nil, nil, routerIDFromNodeIP(s.restCfg))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
handler := &PodHandler{
|
handler := &PodHandler{
|
||||||
Node: s.Node,
|
Node: s.Node,
|
||||||
|
|||||||
Reference in New Issue
Block a user