sfc

package
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: 21 Imported by: 1

Documentation

Overview

Package sfc implements Service Function Chaining between k8s pods and external interfaces in Contiv-VPP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	infra.PluginDeps
	ServiceLabel    servicelabel.ReaderAPI
	ContivConf      contivconf.API
	IDAlloc         idalloc.API
	IPAM            ipam.API
	IPNet           ipnet.API
	NodeSync        nodesync.API
	PodManager      podmanager.API
	GoVPP           govppmux.API
	Stats           statscollector.API
	ConfigRetriever controller.ConfigRetriever
}

Deps defines dependencies of the SFC plugin.

type Option

type Option func(*Plugin)

Option is a function that acts on a Plugin to inject Dependencies or configuration

func UseDeps

func UseDeps(cb func(*Deps)) Option

UseDeps returns Option that can inject custom dependencies.

type Plugin

type Plugin struct {
	Deps
	// contains filtered or unexported fields
}

Plugin watches configuration of K8s resources (as reflected by KSR+CRD into ETCD) for changes in SFCs and pods and updates the chaining configuration in the VPP accordingly.

func NewPlugin

func NewPlugin(opts ...Option) *Plugin

NewPlugin creates a new Plugin with the provides Options

func (*Plugin) AfterInit

func (p *Plugin) AfterInit() error

AfterInit can be used by renderers to perform a second stage of initialization.

func (*Plugin) Close

func (p *Plugin) Close() error

Close is NOOP.

func (*Plugin) HandlesEvent

func (p *Plugin) HandlesEvent(event controller.Event) bool

HandlesEvent selects:

  • any resync event
  • KubeStateChange for SFCs and pods
  • pod custom interfaces update
  • external interfaces update

func (*Plugin) Init

func (p *Plugin) Init() error

Init initializes the SFC plugin and starts watching ETCD for K8s configuration.

func (*Plugin) Resync

func (p *Plugin) Resync(event controller.Event, kubeStateData controller.KubeStateData,
	resyncCount int, txn controller.ResyncOperations) error

Resync is called by Controller to handle event that requires full re-synchronization. For startup resync, resyncCount is 1. Higher counter values identify run-time resync.

func (*Plugin) Revert

func (p *Plugin) Revert(event controller.Event) error

Revert is NOOP.

func (*Plugin) Update

func (p *Plugin) Update(event controller.Event, txn controller.UpdateOperations) (changeDescription string, err error)

Update is called for:

  • KubeStateChange for or SFCs and pods
  • pod custom interfaces update

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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