service

package
v2.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2018 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package service implements Kubernetes Services [1] for Contiv/VPP.

A detailed description of the plugin can be found in the developer's guide for services [2].

[1]: https://kubernetes.io/docs/concepts/services-networking/service/ [2]: docs/dev-guide/SERVICES.md (from the repo's top directory)

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
	Resync       resync.Subscriber
	Watcher      datasync.KeyValProtoWatcher /* prefixed for KSR-published K8s state data */
	Contiv       contiv.API                  /* to get the Node IP and all interface names */
	VPP          vpp.API                     /* interface indexes && IP addresses */
	GoVPP        govppmux.API                /* used for direct NAT binary API calls */
	Stats        statscollector.API          /* used for exporting the statistics */
}

Deps defines dependencies of the service 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 into ETCD) for changes in services, endpoints and pods and updates the NAT 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 registers to the ResyncOrchestrator. The registration is done in this phase in order to ensure that the resync for this plugin is triggered only after resync of the Contiv plugin has finished.

func (*Plugin) Close

func (p *Plugin) Close() error

Close stops watching of KSR reflected data.

func (*Plugin) Init

func (p *Plugin) Init() error

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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