Documentation ¶
Index ¶
- Constants
- func InstallFelixPlugin() (err error)
- type HostEndpoint
- type HostEndpointID
- type IPSet
- type Policy
- type PolicyID
- type PolicyState
- type Rule
- type Server
- func (s *Server) HandlePolicyServerEvents() error
- func (s *Server) MessageReader(conn net.Conn) <-chan interface{}
- func (s *Server) OnVppRestart()
- func (s *Server) RecvMessage(conn net.Conn) (msg interface{}, err error)
- func (s *Server) SendMessage(conn net.Conn, msg interface{}) (err error)
- func (s *Server) ServePolicy(t *tomb.Tomb) error
- func (s *Server) SetOurBGPSpec(nodeBGPSpec *oldv3.NodeBGPSpec)
- func (s *Server) SyncPolicy(conn net.Conn)
- func (s *Server) WorkloadRemoved(id *WorkloadEndpointID, containerIPs []*net.IPNet)
- type SyncState
- type Tier
- type WorkloadEndpoint
- func (w *WorkloadEndpoint) Create(vpp *vpplink.VppLink, swIfIndex uint32, state *PolicyState) (err error)
- func (w *WorkloadEndpoint) Delete(vpp *vpplink.VppLink) (err error)
- func (we *WorkloadEndpoint) String() string
- func (w *WorkloadEndpoint) Update(vpp *vpplink.VppLink, new *WorkloadEndpoint, state *PolicyState) (err error)
- type WorkloadEndpointID
Constants ¶
View Source
const ( FelixPluginSrcPath = "/bin/felix-api-proxy" FelixPluginDstPath = "/var/lib/calico/felix-plugins/felix-api-proxy" )
Variables ¶
This section is empty.
Functions ¶
func InstallFelixPlugin ¶
func InstallFelixPlugin() (err error)
Types ¶
type HostEndpoint ¶
type HostEndpoint struct { UplinkSwIfIndexes []uint32 TapSwIfIndexes []uint32 TunnelSwIfIndexes []uint32 Profiles []string Tiers []Tier ForwardTiers []Tier InterfaceName string // contains filtered or unexported fields }
func (*HostEndpoint) Create ¶
func (h *HostEndpoint) Create(vpp *vpplink.VppLink, state *PolicyState) (err error)
func (*HostEndpoint) String ¶
func (he *HostEndpoint) String() string
func (*HostEndpoint) Update ¶
func (h *HostEndpoint) Update(vpp *vpplink.VppLink, new *HostEndpoint, state *PolicyState) (err error)
type HostEndpointID ¶
type HostEndpointID struct {
EndpointID string
}
type IPSet ¶
type IPSet struct { VppID uint32 Type types.IpsetType IPPorts []types.IPPort Addresses []net.IP Networks []*net.IPNet }
func (*IPSet) AddMembers ¶
type Policy ¶
Policy represents both Policies and Profiles in the calico API
func (*Policy) Create ¶
func (p *Policy) Create(vpp *vpplink.VppLink, state *PolicyState) (err error)
type PolicyState ¶
type PolicyState struct { IPSets map[string]*IPSet Policies map[PolicyID]*Policy Profiles map[string]*Policy WorkloadEndpoints map[WorkloadEndpointID]*WorkloadEndpoint HostEndpoints map[HostEndpointID]*HostEndpoint }
func NewPolicyState ¶
func NewPolicyState() *PolicyState
type Rule ¶
type Rule struct { *types.Rule RuleID string VppID uint32 DstIPPortIPSetNames []string DstNotIPPortIPSetNames []string SrcIPPortIPSetNames []string SrcNotIPPortIPSetNames []string DstIPSetNames []string DstNotIPSetNames []string SrcIPSetNames []string SrcNotIPSetNames []string DstIPPortSetNames []string }
type Server ¶
type Server struct { *common.CalicoVppServerData // contains filtered or unexported fields }
Server holds all the data required to configure the policies defined by felix in VPP
func NewPolicyServer ¶
NewServer creates a policy server
func (*Server) HandlePolicyServerEvents ¶
func (*Server) MessageReader ¶
func (*Server) OnVppRestart ¶
func (s *Server) OnVppRestart()
OnVppRestart notifies the policy server that vpp restarted
func (*Server) RecvMessage ¶
func (*Server) SendMessage ¶
func (*Server) ServePolicy ¶
Serve runs the policy server
func (*Server) SetOurBGPSpec ¶
func (s *Server) SetOurBGPSpec(nodeBGPSpec *oldv3.NodeBGPSpec)
func (*Server) SyncPolicy ¶
SyncPolicy does the bulk of the policy sync job. It starts by reconciling the current configured state in VPP (empty at first) with what is sent by felix, and once both are in sync, it keeps processing felix updates. It also sends endpoint updates to felix when the CNI component adds or deletes container interfaces.
func (*Server) WorkloadRemoved ¶
func (s *Server) WorkloadRemoved(id *WorkloadEndpointID, containerIPs []*net.IPNet)
WorkloadRemoved is called by the CNI server when the interface of a pod is deleted
type WorkloadEndpoint ¶
type WorkloadEndpoint struct { SwIfIndex uint32 Profiles []string Tiers []Tier // contains filtered or unexported fields }
func (*WorkloadEndpoint) Create ¶
func (w *WorkloadEndpoint) Create(vpp *vpplink.VppLink, swIfIndex uint32, state *PolicyState) (err error)
func (*WorkloadEndpoint) Delete ¶
func (w *WorkloadEndpoint) Delete(vpp *vpplink.VppLink) (err error)
func (*WorkloadEndpoint) String ¶
func (we *WorkloadEndpoint) String() string
func (*WorkloadEndpoint) Update ¶
func (w *WorkloadEndpoint) Update(vpp *vpplink.VppLink, new *WorkloadEndpoint, state *PolicyState) (err error)
type WorkloadEndpointID ¶
func (*WorkloadEndpointID) String ¶
func (wi *WorkloadEndpointID) String() string
Click to show internal directories.
Click to hide internal directories.