core

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2017 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package core: The reconcile process "resyncs" the configuration stored in the database, and the provided config yaml file (if there is one). It is possible to start with an empty database if desired by providing the -clean command line arg. The resync procedure loads the configuration into a reconcile "before" resync data structure then applies the configuration which causes new ETCD entries to be made, however, these will be put into the "after" resync data structure during reconcile. Once all config has been processed, the before and after data structures are post-processed. This module drives the resync for the plugins.

Package core: The renderer uses the config for hosts, external entites, and SFC's and invokes the registered CNP driver. Driver API's are invoked for wiring hosts to hosts, hosts to external routers, and the SFC's.

Index

Constants

View Source
const PluginID core.PluginName = "SfcController"

Plugin identifier (must be unique throughout the system)

Variables

This section is empty.

Functions

func LogFlags

func LogFlags()

Dump the command line flags

func RegisterFlags

func RegisterFlags()

Add command line flags here.

Types

type ReconcileVppLabelsMapType

type ReconcileVppLabelsMapType map[string]struct{}

ReconcileVppLabelsMapType: track all the vpp agents in etcd

type SfcControllerCacheType

type SfcControllerCacheType struct {
	EEs  map[string]controller.ExternalEntity
	HEs  map[string]controller.HostEntity
	SFCs map[string]controller.SfcEntity
}

ram cache of controller entities indexed by entity name

type SfcControllerPluginHandler

type SfcControllerPluginHandler struct {
	Etcd    *etcdv3.Plugin
	HTTPmux *rest.Plugin

	ReconcileVppLabelsMap ReconcileVppLabelsMapType
	// contains filtered or unexported fields
}

func (*SfcControllerPluginHandler) Close

func (sfcCtrlPlugin *SfcControllerPluginHandler) Close() error

perform close down procedures

func (*SfcControllerPluginHandler) DatastoreExternalEntityCreate

func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreExternalEntityCreate(ee *controller.ExternalEntity) error

create the specified entity in the sfc db in etcd

func (*SfcControllerPluginHandler) DatastoreExternalEntityDelete

func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreExternalEntityDelete(ee *controller.ExternalEntity) error

Delete the specified entity from the sfc db in the etcd tree

func (*SfcControllerPluginHandler) DatastoreExternalEntityDeleteAll

func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreExternalEntityDeleteAll() error

remove the specified entities from the sfc db in etcd

func (*SfcControllerPluginHandler) DatastoreExternalEntityIterate

func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreExternalEntityIterate(actionFunc func(key string,
	val *controller.ExternalEntity)) error

iterate over the set of specified entities in the sfc tree in etcd

func (*SfcControllerPluginHandler) DatastoreExternalEntityRetrieveAllIntoRamCache

func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreExternalEntityRetrieveAllIntoRamCache() error

pull the specified entities from the sfc db in etcd into the sfc ram cache

func (*SfcControllerPluginHandler) DatastoreExternalEntityUpdate

func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreExternalEntityUpdate(ee *controller.ExternalEntity) error

Update the specified entity in the sfc db in the etcd tree

func (*SfcControllerPluginHandler) DatastoreHostEntityCreate

func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreHostEntityCreate(he *controller.HostEntity) error

create the specified entity in the sfc db in etcd

func (*SfcControllerPluginHandler) DatastoreHostEntityDelete

func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreHostEntityDelete(ee *controller.HostEntity) error

Delete the specified entity from the sfc db in the etcd tree

func (*SfcControllerPluginHandler) DatastoreHostEntityDeleteAll

func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreHostEntityDeleteAll() error

remove the specified entities from the sfc db in etcd

func (*SfcControllerPluginHandler) DatastoreHostEntityIterate

func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreHostEntityIterate(actionFunc func(key string,
	he *controller.HostEntity)) error

iterate over the set of specified entities in the sfc tree in etcd

func (*SfcControllerPluginHandler) DatastoreHostEntityRetrieveAllIntoRamCache

func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreHostEntityRetrieveAllIntoRamCache() error

pull the specified entities from the sfc db in etcd into the sfc ram cache

func (*SfcControllerPluginHandler) DatastoreHostEntityUpdate

func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreHostEntityUpdate(ee *controller.HostEntity) error

Update the specified entity in the sfc db in the etcd tree

func (*SfcControllerPluginHandler) DatastoreReInitialize

func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreReInitialize() error

clear the sfc tree in etcd

func (*SfcControllerPluginHandler) DatastoreSfcEntityCreate

func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreSfcEntityCreate(sfc *controller.SfcEntity) error

create the specified entity in the sfc db in etcd

func (*SfcControllerPluginHandler) DatastoreSfcEntityDelete

func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreSfcEntityDelete(ee *controller.HostEntity) error

Delete the specified entity from the sfc db in the etcd tree

func (*SfcControllerPluginHandler) DatastoreSfcEntityDeleteAll

func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreSfcEntityDeleteAll() error

remove the specified entities from the sfc db in etcd

func (*SfcControllerPluginHandler) DatastoreSfcEntityIterate

func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreSfcEntityIterate(actionFunc func(key string,
	sfc *controller.SfcEntity)) error

iterate over the set of specified entities in the sfc tree in etcd

func (*SfcControllerPluginHandler) DatastoreSfcEntityRetrieveAllIntoRamCache

func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreSfcEntityRetrieveAllIntoRamCache() error

pull the specified entities from the sfc db in etcd into the sfc ram cache

func (*SfcControllerPluginHandler) DatastoreSfcEntityUpdate

func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreSfcEntityUpdate(ee *controller.HostEntity) error

Update the specified entity in the sfc db in the etcd tree

func (*SfcControllerPluginHandler) Init

func (sfcCtrlPlugin *SfcControllerPluginHandler) Init() error

Init the controller, read the db, reconcile/resync, render config to etcd

func (*SfcControllerPluginHandler) InitHttpHandlers

func (sfcCtrlPlugin *SfcControllerPluginHandler) InitHttpHandlers()

InitHttpHandlers: register the handler funcs for GET and POST, TODO PUT/DELETE

func (*SfcControllerPluginHandler) InitRamCache

func (sfcCtrlPlugin *SfcControllerPluginHandler) InitRamCache()

create the ram cache

func (*SfcControllerPluginHandler) ReadEtcdDatastoreIntoRamCache

func (sfcCtrlPlugin *SfcControllerPluginHandler) ReadEtcdDatastoreIntoRamCache() error

pull the sfc db from the etcd tree into the ram cache

func (*SfcControllerPluginHandler) ReconcileEnd

func (sfcCtrlPlugin *SfcControllerPluginHandler) ReconcileEnd() error

ReconcileEnd: perform post processing of the reconcile procedure

func (*SfcControllerPluginHandler) ReconcileInit

func (sfcCtrlPlugin *SfcControllerPluginHandler) ReconcileInit() error

ReconcileInit: initialize the map of all etcd vpp/agent labels

func (*SfcControllerPluginHandler) ReconcileLoadAllVppLabels

func (sfcCtrlPlugin *SfcControllerPluginHandler) ReconcileLoadAllVppLabels()

ReconcileLoadAllVppLabels: retrieve all vpp lavels from the etcd datastore

func (*SfcControllerPluginHandler) ReconcileStart

func (sfcCtrlPlugin *SfcControllerPluginHandler) ReconcileStart() error

ReconcileStart: init the reconcile procedure for all plguins

func (*SfcControllerPluginHandler) WriteRamCacheToEtcd

func (sfcCtrlPlugin *SfcControllerPluginHandler) WriteRamCacheToEtcd() error

flush the ram cache to the sfc cache to the tree in etcd

type YamlConfig

type YamlConfig struct {
	Version     string                      `json:"sfc_controller_config_version"`
	Description string                      `json:"description"`
	EEs         []controller.ExternalEntity `json:"external_entities"`
	HEs         []controller.HostEntity     `json:"host_entities"`
	SFCs        []controller.SfcEntity      `json:"sfc_entities"`
}

Jump to

Keyboard shortcuts

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