watchers

package
v3.27.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0, Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareStringSlices added in v3.26.0

func CompareStringSlices(slice1, slice2 []string) bool

func GetUplinkMtu

func GetUplinkMtu() int

func NewK8SClient added in v3.25.1

func NewK8SClient(timeout time.Duration, addToSchemes []func(s *runtime.Scheme) error) (*client.WithWatch, error)

func NewSecretWatcher

func NewSecretWatcher(c SecretWatcherClient, k8sclient *kubernetes.Clientset) (*secretWatcher, error)

Types

type BGPConfigurationWatcher

type BGPConfigurationWatcher struct {
	BGPConfigurationWatcherEventChan chan common.CalicoVppEvent
	BGPConf                          *calicov3.BGPConfigurationSpec
	// contains filtered or unexported fields
}

func NewBGPConfigurationWatcher

func NewBGPConfigurationWatcher(clientv3 calicov3cli.Interface, log *logrus.Entry) *BGPConfigurationWatcher

func (*BGPConfigurationWatcher) GetBGPConf

For now, this doesn't watch the BGP configuration nor produce events

func (*BGPConfigurationWatcher) WatchBGPConfiguration

func (w *BGPConfigurationWatcher) WatchBGPConfiguration(t *tomb.Tomb) error

type BGPFilterWatcher added in v3.26.0

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

func NewBGPFilterWatcher added in v3.26.0

func NewBGPFilterWatcher(clientv3 calicov3cli.Interface, k8sclient *kubernetes.Clientset, log *logrus.Entry) *BGPFilterWatcher

func (*BGPFilterWatcher) AddNewFilter added in v3.26.0

func (w *BGPFilterWatcher) AddNewFilter(filter calicov3.BGPFilter)

func (*BGPFilterWatcher) RemoveFilter added in v3.26.0

func (w *BGPFilterWatcher) RemoveFilter(filter calicov3.BGPFilter)

func (*BGPFilterWatcher) UpdateFilter added in v3.26.0

func (w *BGPFilterWatcher) UpdateFilter(filter calicov3.BGPFilter)

func (*BGPFilterWatcher) WatchBGPFilters added in v3.26.0

func (w *BGPFilterWatcher) WatchBGPFilters(t *tomb.Tomb) error

This function watches BGPFilters configured in Calico

type BGPPrefixesPolicyAndAssignment added in v3.26.0

type BGPPrefixesPolicyAndAssignment struct {
	PolicyAssignment *bgpapi.PolicyAssignment
	Policy           *bgpapi.Policy
	Prefixes         []*bgpapi.DefinedSet
}

type ImpExpPol added in v3.26.0

type LinkWatcher

type LinkWatcher struct {
	UplinkStatuses map[string]config.UplinkStatus
	// contains filtered or unexported fields
}

func NewLinkWatcher

func NewLinkWatcher(uplinkStatus map[string]config.UplinkStatus, log *log.Entry) *LinkWatcher

func (*LinkWatcher) ResetMTU

func (r *LinkWatcher) ResetMTU(link netlink.Link, mtu int) (err error)
func (r *LinkWatcher) WatchLinks(t *tomb.Tomb) error

type LocalBGPPeer added in v3.26.0

type LocalBGPPeer struct {
	Peer           *bgpapi.Peer
	BGPFilterNames []string
	BGPPolicies    map[string]*ImpExpPol
	NeighborSet    *bgpapi.DefinedSet
}

type LocalSIDWatcher

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

func NewLocalSIDWatcher

func NewLocalSIDWatcher(vpp *vpplink.VppLink, clientv3 calicov3cli.Interface, log *logrus.Entry) *LocalSIDWatcher

func (*LocalSIDWatcher) AdvertiseSRv6Policy

func (p *LocalSIDWatcher) AdvertiseSRv6Policy(localsid *types.SrLocalsid) (err error)

func (*LocalSIDWatcher) SetOurBGPSpec

func (w *LocalSIDWatcher) SetOurBGPSpec(nodeBGPSpec *common.LocalNodeSpec)

func (*LocalSIDWatcher) WatchLocalSID

func (w *LocalSIDWatcher) WatchLocalSID(t *tomb.Tomb) error

type NetWatcher

type NetWatcher struct {
	InSync chan interface{}

	NetWatcher watch.Interface
	NadWatcher watch.Interface
	// contains filtered or unexported fields
}

func NewNetWatcher

func NewNetWatcher(vpp *vpplink.VppLink, log *logrus.Entry) *NetWatcher

func (*NetWatcher) CreateNetwork added in v3.26.0

func (w *NetWatcher) CreateNetwork(networkName string, networkVni uint32, netRange string, phyNet string) (netDef *NetworkDefinition, err error)

func (*NetWatcher) DeleteNetwork added in v3.26.0

func (w *NetWatcher) DeleteNetwork(networkName string) (*NetworkDefinition, error)

func (*NetWatcher) GetNodeIPs added in v3.26.0

func (w *NetWatcher) GetNodeIPs() (ip4 *net.IP, ip6 *net.IP)

func (*NetWatcher) OnNetAdded

func (w *NetWatcher) OnNetAdded(net *networkv3.Network) error

func (*NetWatcher) OnNetChanged

func (w *NetWatcher) OnNetChanged(old, new *networkv3.Network)

func (*NetWatcher) OnNetDeleted

func (w *NetWatcher) OnNetDeleted(netName string) error

func (*NetWatcher) SetOurBGPSpec added in v3.26.0

func (w *NetWatcher) SetOurBGPSpec(nodeBGPSpec *common.LocalNodeSpec)

func (*NetWatcher) Stop

func (w *NetWatcher) Stop()

func (*NetWatcher) WatchNetworks

func (w *NetWatcher) WatchNetworks(t *tomb.Tomb) error

type NetworkDefinition

type NetworkDefinition struct {
	// VRF is the main table used for the corresponding physical network
	VRF VRF
	// PodVRF is the table used for the pods in the corresponding physical network
	PodVRF              VRF
	Vni                 uint32
	PhysicalNetworkName string
	Name                string
	Range               string
	NetAttachDefs       string
}

type PeerWatcher

type PeerWatcher struct {
	BGPConf *calicov3.BGPConfigurationSpec
	// contains filtered or unexported fields
}

func NewPeerWatcher

func NewPeerWatcher(clientv3 calicov3cli.Interface, k8sclient *kubernetes.Clientset, log *logrus.Entry) *PeerWatcher

func (*PeerWatcher) OnSecretUpdate

func (w *PeerWatcher) OnSecretUpdate(old, new *v1.Secret)

This function gets called from SecretWatcher when a secret is added, updated or deleted

func (*PeerWatcher) SetBGPConf

func (w *PeerWatcher) SetBGPConf(bgpConf *calicov3.BGPConfigurationSpec)

func (*PeerWatcher) WatchBGPPeers

func (w *PeerWatcher) WatchBGPPeers(t *tomb.Tomb) error

This function watches BGP peers configured in Calico These peers are configured in GoBGP in addition to the other nodes in the cluster They may also control which nodes to pair with if the peerSelector is set

type PrefixWatcher

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

func NewPrefixWatcher

func NewPrefixWatcher(client *calicocli.Client, log *logrus.Entry) *PrefixWatcher

func (*PrefixWatcher) SetOurBGPSpec

func (w *PrefixWatcher) SetOurBGPSpec(nodeBGPSpec *common.LocalNodeSpec)

func (*PrefixWatcher) WatchPrefix

func (w *PrefixWatcher) WatchPrefix(t *tomb.Tomb) error

watchPrefix watches etcd /calico/ipam/v2/host/$NODENAME and add/delete aggregated routes which are assigned to the node. This function also updates policy appropriately.

type RouteWatcher

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

func NewRouteWatcher

func NewRouteWatcher(log *log.Entry) *RouteWatcher

func (*RouteWatcher) AddRoute

func (r *RouteWatcher) AddRoute(route *netlink.Route) (err error)

func (*RouteWatcher) DelRoute

func (r *RouteWatcher) DelRoute(route *netlink.Route) (err error)

func (*RouteWatcher) RestoreAllRoutes

func (r *RouteWatcher) RestoreAllRoutes() (err error)

func (*RouteWatcher) WatchRoutes

func (r *RouteWatcher) WatchRoutes(t *tomb.Tomb) error

type SecretWatcherClient

type SecretWatcherClient interface {
	// this function is invoked upon add|update|delete of a secret
	OnSecretUpdate(old, new *v1.Secret)
}

type VRF

type VRF struct {
	Tables [2]uint32 // one for ipv4, one for ipv6
}

Jump to

Keyboard shortcuts

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