Help us shape the future of Go! Take the 2026 Go Developer Survey

manager

package
v1.20.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 29 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInstanceDoesNotExist = errors.New("instance does not exist")
)

Functions

func NewBGPRouterManager added in v1.19.0

func NewBGPRouterManager(params bgpRouterManagerParams) agent.BGPRouterManager

NewBGPRouterManager constructs a new BGPRouterManager.

Types

type BGPManagerMetrics added in v1.19.0

type BGPManagerMetrics struct {
	// ReconcileErrorsTotal is the number of errors during reconciliation of the BGP manager.
	ReconcileErrorsTotal metric.Vec[metric.Counter]

	// ReconcileRunDuration measures the duration of the reconciliation run. Histogram can
	// be used to observe the total number of reconciliation runs and distribution of the run
	// duration.
	ReconcileRunDuration metric.Vec[metric.Observer]
}

func NewBGPManagerMetrics added in v1.19.0

func NewBGPManagerMetrics() *BGPManagerMetrics

type BGPRouterManager added in v1.19.0

type BGPRouterManager struct {
	lock.RWMutex

	// BGP instances and reconcilers
	BGPInstances      LocalInstanceMap
	ConfigReconcilers []reconciler.ConfigReconciler

	// statedb tables
	DB                  *statedb.DB
	ReconcileErrorTable statedb.RWTable[*tables.BGPReconcileError]
	// contains filtered or unexported fields
}

BGPRouterManager implements the agent's BGPRouterManager interface.

Logically, this manager views each BGP instance within a CiliumBGPClusterConfig as a BGP router instantiated on its host.

This manager employs two main data structures to implement its high level business logic:

A reconcileDiff is used to establish which BGP instances must be created, and removed from the Manager along with which instances must have their configurations reconciled.

A set of ConfigReconcilers, which usages are wrapped by the reconcileBGPConfig function, reconcile configuration of individual BGP instances.

Together, the high-level flow the manager takes is:

  • instantiate a reconcilerDiff to compute which BGP instances to create, remove, and reconcile,
  • create any instances necessary, run reconcileBGPConfig on each,
  • run each config reconciler, by way of calling reconcileBGPConfig on any instances marked for reconcile.

func (*BGPRouterManager) DestroyRouterOnStop added in v1.19.0

func (m *BGPRouterManager) DestroyRouterOnStop(destroy bool)

DestroyRouterOnStop should be set to true if the underlying router should be fully destroyed upon Stop(). Note that this causes sending a Cease notification to BGP peers, which terminates Graceful Restart. Full destroy is useful especially for tests, where multiple instances of the RouterManager may be running.

func (*BGPRouterManager) GetPeers added in v1.19.0

func (*BGPRouterManager) GetPeersLegacy added in v1.19.2

func (m *BGPRouterManager) GetPeersLegacy(ctx context.Context) ([]*models.BgpPeer, error)

GetPeersLegacy gets peering state from previously initialized bgp instances.

func (*BGPRouterManager) GetRoutePolicies added in v1.19.0

GetRoutePolicies fetches BGP routing policies from underlying routing daemon.

func (*BGPRouterManager) GetRoutePoliciesLegacy added in v1.20.0

func (m *BGPRouterManager) GetRoutePoliciesLegacy(ctx context.Context, params restapi.GetBgpRoutePoliciesParams) ([]*models.BgpRoutePolicy, error)

GetRoutePoliciesLegacy fetches BGP routing policies from underlying routing daemon.

func (*BGPRouterManager) GetRoutes added in v1.19.0

GetRoutes retrieves routes from the RIB of underlying routers.

func (*BGPRouterManager) GetRoutesLegacy added in v1.19.2

func (m *BGPRouterManager) GetRoutesLegacy(ctx context.Context, params restapi.GetBgpRoutesParams) ([]*models.BgpRoute, error)

GetRoutesLegacy retrieves routes from the RIB of underlying router

func (*BGPRouterManager) ReconcileInstances added in v1.19.0

func (m *BGPRouterManager) ReconcileInstances(ctx context.Context,
	nodeObj *v2.CiliumBGPNodeConfig,
	ciliumNode *v2.CiliumNode) error

ReconcileInstances is an API for configuring the BGP Instances from the desired CiliumBGPNodeConfig resource.

ReconcileInstances will evaluate BGP instances to be created, removed and reconciled.

func (*BGPRouterManager) Start added in v1.19.0

func (m *BGPRouterManager) Start(_ cell.HookContext) error

func (*BGPRouterManager) Stop added in v1.19.0

func (m *BGPRouterManager) Stop(ctx cell.HookContext) error

Stop cleans up all servers, called by hive lifecycle at shutdown

type LocalInstanceMap added in v1.19.0

type LocalInstanceMap map[string]*instance.BGPInstance

LocalInstanceMap maps instance names to their associated BgpInstances and configuration info.

type State added in v1.19.0

type State struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL