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
- func LogFlags()
- func RegisterFlags()
- type ReconcileVppLabelsMapType
- type SfcControllerCacheType
- type SfcControllerPluginHandler
- func (sfcCtrlPlugin *SfcControllerPluginHandler) Close() error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreExternalEntityCreate(ee *controller.ExternalEntity) error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreExternalEntityDelete(ee *controller.ExternalEntity) error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreExternalEntityDeleteAll() error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreExternalEntityIterate(actionFunc func(key string, val *controller.ExternalEntity)) error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreExternalEntityRetrieveAllIntoRamCache() error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreExternalEntityUpdate(ee *controller.ExternalEntity) error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreHostEntityCreate(he *controller.HostEntity) error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreHostEntityDelete(ee *controller.HostEntity) error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreHostEntityDeleteAll() error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreHostEntityIterate(actionFunc func(key string, he *controller.HostEntity)) error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreHostEntityRetrieveAllIntoRamCache() error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreHostEntityUpdate(ee *controller.HostEntity) error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreReInitialize() error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreSfcEntityCreate(sfc *controller.SfcEntity) error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreSfcEntityDelete(ee *controller.HostEntity) error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreSfcEntityDeleteAll() error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreSfcEntityIterate(actionFunc func(key string, sfc *controller.SfcEntity)) error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreSfcEntityRetrieveAllIntoRamCache() error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) DatastoreSfcEntityUpdate(ee *controller.HostEntity) error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) Init() error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) InitHttpHandlers()
- func (sfcCtrlPlugin *SfcControllerPluginHandler) InitRamCache()
- func (sfcCtrlPlugin *SfcControllerPluginHandler) ReadEtcdDatastoreIntoRamCache() error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) ReconcileEnd() error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) ReconcileInit() error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) ReconcileLoadAllVppLabels()
- func (sfcCtrlPlugin *SfcControllerPluginHandler) ReconcileStart() error
- func (sfcCtrlPlugin *SfcControllerPluginHandler) WriteRamCacheToEtcd() error
- type YamlConfig
Constants ¶
const PluginID core.PluginName = "SfcController"
Plugin identifier (must be unique throughout the system)
Variables ¶
This section is empty.
Functions ¶
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"` }