renderer

package
Version: v3.3.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContivSFC

type ContivSFC struct {
	// Name uniquely identifies a service function chain.
	Name string

	// Unidirectional is true if the service chain should be unidirectional (the traffic should pass in one way only).
	// Otherwise the chain is bidirectional (the traffic can pass both ways).
	Unidirectional bool

	// Network defines a custom network where the chain is being rendered,
	// may be empty in case of the default network.
	Network string

	// Chain contains a list of instances of the service function chain
	// (each chain can render into multiple instances e.g. in case of multiple pods
	// matching a pod selector)
	Chain []*ServiceFunction
}

ContivSFC is a less-abstract, free of indirect references representation of Service Function Chain in Contiv. It contains lists of individual chain instances, each referencing pods that need to be chained together.

func (ContivSFC) String

func (sfc ContivSFC) String() string

String converts ContivSFC into a human-readable string.

type InterfaceNames

type InterfaceNames struct {
	// LogicalName for local pods, LogicalName contain actual pod interface name which can be used for configuration
	// without further processing. LogicalName for non-local pods contain name from CRD.
	LogicalName string
	// CRDName is name of the interface as it came from CRD
	CRDName string
}

InterfaceNames is container for multiple names for one interface

func (InterfaceNames) String

func (in InterfaceNames) String() string

String converts InterfaceNames into a human-readable string.

type InterfaceSF

type InterfaceSF struct {
	// InterfaceName contains name of the interface to/from which the traffic flows
	// (can be used for the configuration without further processing).
	InterfaceName    string // name of the vpp interface attached to this external interface
	VppInterfaceName string // true if this is a node-local interface

	NodeID uint32 // ID of the node where the interface resides
	Local  bool   // true if this is a node-local interface
}

InterfaceSF represents an interface-type service function.

func (InterfaceSF) String

func (iface InterfaceSF) String() string

String converts InterfaceSF into a human-readable string.

type PodSF

type PodSF struct {
	ID     pod.ID // pod identifier
	NodeID uint32 // ID of the node where the service function runs
	Local  bool   // true if this is a node-local pod

	InputInterface  *InterfaceNames // names of the interface trough which the traffic enters the pod
	OutputInterface *InterfaceNames // names of the interface using which the traffic leaves the pod
}

PodSF represents a pod-type service function.

func (PodSF) String

func (pod PodSF) String() string

String converts PodSF into a human-readable string.

type ResyncEventData

type ResyncEventData struct {
	// Chains is a list of all currently deployed service function chains.
	Chains []*ContivSFC
}

ResyncEventData wraps an entire state of K8s services as provided by the Processor.

func (ResyncEventData) String

func (red ResyncEventData) String() string

String converts ResyncEventData into a human-readable string.

type SFCRendererAPI

type SFCRendererAPI interface {
	// AddChain is called for a newly added service function chain.
	AddChain(chain *ContivSFC) error

	// UpdateChain informs renderer about a change in the configuration
	// or in the state of a service function chain.
	UpdateChain(oldChain, newChain *ContivSFC) error

	// DeleteChain is called for every removed service function chain.
	DeleteChain(chain *ContivSFC) error

	// Resync provides a complete snapshot of all service function chain-related data.
	// The renderer should resolve any discrepancies between the state of SFC in K8s
	// and the currently rendered configuration.
	Resync(resyncEv *ResyncEventData) error
}

SFCRendererAPI defines the API of Service Function Chain Renderer.

type ServiceFunction

type ServiceFunction struct {
	// Type defines the type of the service function
	Type ServiceFunctionType

	// Pods satisfying the pod selector criteria for this service function.
	Pods []*PodSF

	// ExternalInterfaces contains list of interfaces satisfying
	// the interface selector criteria for this service function.
	ExternalInterfaces []*InterfaceSF
}

ServiceFunction represents a single service function element in the chain.

It can be represented by multiple interfaces or running pods, which can render into multiple traffic paths. It is the responsibility of the SFC renderer to render that into a physical networking configuration that makes sense for the particular case (e.g. load-balance the traffic through multiple chains, or just select one of the candidate pods making the rest of the pods a hot backup).

func (ServiceFunction) String

func (sf ServiceFunction) String() string

String converts ServiceFunction into a human-readable string.

type ServiceFunctionType

type ServiceFunctionType int

ServiceFunctionType defines type of a service function in the chain.

const (
	// Pod means that the service function item is a k8s pod.
	Pod ServiceFunctionType = 0

	// ExternalInterface means that the service function item is an external VPP interface.
	ExternalInterface ServiceFunctionType = iota
)

func (ServiceFunctionType) String

func (t ServiceFunctionType) String() string

String converts ProtocolType into a human-readable string.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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