Documentation
¶
Index ¶
- Constants
- type Handler
- type L2FIBEntry
- type NimbessAgent
- func (s *NimbessAgent) Add(ctx context.Context, req *cni.CNIRequest) (*cni.CNIReply, error)
- func (s *NimbessAgent) Delete(ctx context.Context, req *cni.CNIRequest) (*cni.CNIReply, error)
- func (s *NimbessAgent) EnsureNetwork(network string) (bool, error)
- func (s *NimbessAgent) Init() error
- func (s *NimbessAgent) Run() error
- type NimbessPipeline
- func (s *NimbessPipeline) AddPort(name string, port *network.Port) (*network.EgressPort, error)
- func (s *NimbessPipeline) DisconnectPipeline(modType reflect.Type) error
- func (s *NimbessPipeline) GetEgressPorts() []*network.EgressPort
- func (s *NimbessPipeline) GetLastModule(excludedTypes []reflect.Type) network.PipelineModule
- func (s *NimbessPipeline) GetModule(name string) network.PipelineModule
- func (s *NimbessPipeline) GetModuleFromType(modType reflect.Type) network.PipelineModule
- func (s *NimbessPipeline) Init(port string, forwarder string, metaPipeline *NimbessPipeline) error
- func (s *NimbessPipeline) InsertModule(mod network.PipelineModule, index int, agent *NimbessAgent) error
- func (s *NimbessPipeline) RemoveModule(modName string, agent *NimbessAgent) error
- type UNPGazer
Constants ¶
const ( CniOk = 0 CniIncompatible = 1 InvalidNetworkConfig = 2 ContainerNotExist = 3 CniTryLater = 11 DriverFailure = 101 FastPathFailure = 102 InternalIPAM = "nimbess" FastPathNetwork = "fastpath" DefaultBaseCNIDir = "/var/lib/nimbess/cni" DefaultPodNs = "default" )
CNI Reply Values
const (
ALL_NETWORKS = "ALL_NETWORKS"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type L2FIBEntry ¶
type L2FIBEntry struct {
// contains filtered or unexported fields
}
type NimbessAgent ¶
type NimbessAgent struct { ID string EtcdContext context.Context Mu *sync.Mutex Config *config.NimbessConfig Driver drivers.Driver KubeClient kubernetes.Interface // Pipelines contains a map of port name to pipeline pointer Pipelines map[string]*NimbessPipeline // MetaPipelines contains a map of network name to abstract pipelines MetaPipelines map[string]*NimbessPipeline EtcdClient etcdv3.Client // contains filtered or unexported fields }
func (*NimbessAgent) Add ¶
func (s *NimbessAgent) Add(ctx context.Context, req *cni.CNIRequest) (*cni.CNIReply, error)
Add implements CNI Add Handler. It returns a CNI Reply to be sent to the Nimbess CNI client.
func (*NimbessAgent) Delete ¶
func (s *NimbessAgent) Delete(ctx context.Context, req *cni.CNIRequest) (*cni.CNIReply, error)
Delete implements CNI Delete Handler. It returns a CNI Reply to be sent to the Nimbess CNI client.
func (*NimbessAgent) EnsureNetwork ¶
func (s *NimbessAgent) EnsureNetwork(network string) (bool, error)
EnsureNetwork ensures that a network exists already in meta pipelines and if not, creates it from a network attachment definition. If the network attachment definition does not exist, an error is thrown. boolean returned is true if this network already existed in meta pipelines, false if it was initialized here
type NimbessPipeline ¶
type NimbessPipeline struct { Name string Mu *sync.Mutex Modules []network.PipelineModule Driver drivers.Driver EgressPorts []*network.EgressPort MetaKey string Gateway string // contains filtered or unexported fields }
NimbessPipeline implements a Pipeline of network functions for packet traversal
func (*NimbessPipeline) AddPort ¶
func (s *NimbessPipeline) AddPort(name string, port *network.Port) (*network.EgressPort, error)
AddPort adds a port to a pipeline. It returns a pointer to a EgressPort module to update other pipelines with
func (*NimbessPipeline) DisconnectPipeline ¶
func (s *NimbessPipeline) DisconnectPipeline(modType reflect.Type) error
DisconnectPipeline disconnects any modules of type modType that are attached to the last module in a pipeline
func (*NimbessPipeline) GetEgressPorts ¶
func (s *NimbessPipeline) GetEgressPorts() []*network.EgressPort
func (*NimbessPipeline) GetLastModule ¶
func (s *NimbessPipeline) GetLastModule(excludedTypes []reflect.Type) network.PipelineModule
GetLastModule returns a pointer to the last module in a pipeline. excludedTypes may be used to exclude modules of certain types (like EgressPort).
func (*NimbessPipeline) GetModule ¶
func (s *NimbessPipeline) GetModule(name string) network.PipelineModule
GetModule returns the module
func (*NimbessPipeline) GetModuleFromType ¶
func (s *NimbessPipeline) GetModuleFromType(modType reflect.Type) network.PipelineModule
GetModuleFromType gets the first Module found of a specific type
func (*NimbessPipeline) Init ¶
func (s *NimbessPipeline) Init(port string, forwarder string, metaPipeline *NimbessPipeline) error
Init is responsible for initializing a new pipeline. It checks the abstract pipeline for a network and builds the pipeline for this port. If meta pipeline is not nil, s is a port pipeline.
func (*NimbessPipeline) InsertModule ¶
func (s *NimbessPipeline) InsertModule(mod network.PipelineModule, index int, agent *NimbessAgent) error
Inserts a Module at position idx in a pipeline. If idx is 0, the module is inserted after the source port If index is less than 0, it is inserted at the end of pipeline before all egress ports agent is a pointer to the NimbessAgent to use to render the changes when a port pipeline is updated
func (*NimbessPipeline) RemoveModule ¶
func (s *NimbessPipeline) RemoveModule(modName string, agent *NimbessAgent) error
RemoveModule removes a module from a pipeline agent is a pointer to the agent to use to render the changes when a port pipeline is updated
type UNPGazer ¶
func (*UNPGazer) GetChannel ¶
func (*UNPGazer) ProcessEvent ¶
func (u *UNPGazer) ProcessEvent(event *clientv3.Event, s *NimbessAgent)
func (*UNPGazer) ProcessUNP ¶
func (u *UNPGazer) ProcessUNP(unp *v1.UnifiedNetworkPolicy, s *NimbessAgent, add bool) error