Documentation ¶
Overview ¶
Package bgpreflector reflects BGP routes installed in the host system's network stack (default network namespace) into VPP.
For now it only reflects the routes installed by the Bird daemon (https://bird.network.cz/) - routes with the protocol number 12, as defined in /etc/iproute2/rt_protos
As of now, bgpreflector is only enabled if useExternalIPAM == true in Contiv IPAM config.
Index ¶
- Variables
- type BGPReflector
- func (br *BGPReflector) Close() error
- func (br *BGPReflector) HandlesEvent(event controller.Event) bool
- func (br *BGPReflector) Init() (err error)
- func (br *BGPReflector) Resync(event controller.Event, kubeStateData controller.KubeStateData, ...) (err error)
- func (br *BGPReflector) Revert(event controller.Event) error
- func (br *BGPReflector) Update(event controller.Event, txn controller.UpdateOperations) (changeDescription string, err error)
- type BGPRouteUpdate
- func (ev *BGPRouteUpdate) Direction() controller.UpdateDirectionType
- func (ev *BGPRouteUpdate) Done(error)
- func (ev *BGPRouteUpdate) GetName() string
- func (ev *BGPRouteUpdate) IsBlocking() bool
- func (ev *BGPRouteUpdate) Method() controller.EventMethodType
- func (ev *BGPRouteUpdate) String() string
- func (ev *BGPRouteUpdate) TransactionType() controller.UpdateTransactionType
- type BGPRouteUpdateType
- type Deps
- type Option
Constants ¶
This section is empty.
Variables ¶
var DefaultPlugin = *NewPlugin()
DefaultPlugin is a default instance of BGPReflector plugin.
Functions ¶
This section is empty.
Types ¶
type BGPReflector ¶
type BGPReflector struct { Deps // contains filtered or unexported fields }
BGPReflector plugin implements BGP route reflection from Linux host to VPP.
func NewPlugin ¶
func NewPlugin(opts ...Option) *BGPReflector
NewPlugin creates a new Plugin with the provides Options
func (*BGPReflector) HandlesEvent ¶
func (br *BGPReflector) HandlesEvent(event controller.Event) bool
HandlesEvent selects:
- any Resync event
- BGPRouteUpdate
func (*BGPReflector) Init ¶
func (br *BGPReflector) Init() (err error)
Init is NOOP - the plugin is initialized during the first resync.
func (*BGPReflector) Resync ¶
func (br *BGPReflector) Resync(event controller.Event, kubeStateData controller.KubeStateData, resyncCount int, txn controller.ResyncOperations) (err error)
Resync resynchronizes BGPReflector against the BGP routes in the Linux host. A set of already allocated pod IPs is updated.
func (*BGPReflector) Revert ¶
func (br *BGPReflector) Revert(event controller.Event) error
Revert is NOOP - never called.
func (*BGPReflector) Update ¶
func (br *BGPReflector) Update(event controller.Event, txn controller.UpdateOperations) (changeDescription string, err error)
Update handles BGPRouteUpdate events.
type BGPRouteUpdate ¶
type BGPRouteUpdate struct { Type BGPRouteUpdateType DstNetwork *net.IPNet GwAddr net.IP }
BGPRouteUpdate is triggered when a BGP route on the host changes.
func (*BGPRouteUpdate) Direction ¶
func (ev *BGPRouteUpdate) Direction() controller.UpdateDirectionType
Direction is Forward.
func (*BGPRouteUpdate) GetName ¶
func (ev *BGPRouteUpdate) GetName() string
GetName returns name of the BGPRouteUpdate event.
func (*BGPRouteUpdate) IsBlocking ¶
func (ev *BGPRouteUpdate) IsBlocking() bool
IsBlocking returns false.
func (*BGPRouteUpdate) Method ¶
func (ev *BGPRouteUpdate) Method() controller.EventMethodType
Method is Update.
func (*BGPRouteUpdate) String ¶
func (ev *BGPRouteUpdate) String() string
String describes BGPRouteUpdate event.
func (*BGPRouteUpdate) TransactionType ¶
func (ev *BGPRouteUpdate) TransactionType() controller.UpdateTransactionType
TransactionType is BestEffort.
type BGPRouteUpdateType ¶
type BGPRouteUpdateType int
BGPRouteUpdateType represents type of the BGP update.
const ( // RouteAdd represents addition of a new BGP route. RouteAdd BGPRouteUpdateType = iota // RouteDelete represents deletion of a BGP route. RouteDelete )
func (BGPRouteUpdateType) String ¶
func (t BGPRouteUpdateType) String() string
type Deps ¶
type Deps struct { infra.PluginDeps ContivConf contivconf.API EventLoop controller.EventLoop }
Deps lists dependencies of the BGPReflector plugin.