crm

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GetEnvoyVersionCmd = "get-cluster-envoy-version"
	CRMCmd             = "crmcmd"
)
View Source
const CloudletInfoCacheKey = "cloudletInfo"
View Source
const CloudletInfoUpdateExpireMultiple = 20 // relative to PlatformHaInstanceActiveExpireTime how long cloudletInfo cache is valid
View Source
const CloudletInfoUpdateRefreshMultiple = 9 // relative to PlatformHaInstanceActiveExpireTime how often to refresh cloudlet info
View Source
const ControllerTimeout = 1 * time.Minute
View Source
const InitCompatibilityVersionKey = "initCompatVersion"

Variables

This section is empty.

Functions

func InitClientNotify

func InitClientNotify(client *notify.Client, nodeMgr *node.NodeMgr, crmd *CRMData, cd *crmutil.CRMHandler)

InitClientNotify initiates the notify send/recv

func InitDebug

func InitDebug(nodeMgr *node.NodeMgr)

func InitSrvNotify

func InitSrvNotify(notifyServer *notify.ServerMgr, nodeMgr *node.NodeMgr, controllerData *crmutil.CRMHandler)

func Run

func Run(builders map[string]pf.PlatformBuilder)

func Start

func Start(builders map[string]pf.PlatformBuilder) error

func Stop

func Stop()

Types

type CRMData

type CRMData struct {
	*crmutil.CRMHandler

	ControllerWait           chan bool
	ControllerSyncInProgress bool
	ControllerSyncDone       chan bool
	WaitPlatformActive       chan bool
	PlatformCommonInitDone   bool

	UpdateHACompatibilityVersion bool
	ExecReqHandler               *ExecReqHandler
	ExecReqSend                  *notify.ExecRequestSend

	AppInstInfoCache     edgeproto.AppInstInfoCache
	CloudletInfoCache    edgeproto.CloudletInfoCache
	ClusterInstInfoCache edgeproto.ClusterInstInfoCache
	VMPool               edgeproto.VMPool
	VMPoolMux            sync.Mutex
	VMPoolUpdateMux      sync.Mutex
	// contains filtered or unexported fields
}

CRMData is a wrapper around crmutil.CRMHandler and uses it in the context of the on-edge-site CRM. CRMData is updated via notify, and changes are sent back via notify.

func NewCRMData

func NewCRMData(platform pf.Platform, key *edgeproto.CloudletKey, nodeMgr *node.NodeMgr, haMgr *redundancy.HighAvailabilityManager) *CRMData

func (*CRMData) FinishInfraResourceRefreshThread

func (s *CRMData) FinishInfraResourceRefreshThread()

func (*CRMData) FinishUpdateCloudletInfoHAThread

func (s *CRMData) FinishUpdateCloudletInfoHAThread()

func (*CRMData) GetCloudletInfoFromHACache

func (cd *CRMData) GetCloudletInfoFromHACache(ctx context.Context, cloudletInfo *edgeproto.CloudletInfo) error

func (*CRMData) GetClusterEnvoyVersion

func (s *CRMData) GetClusterEnvoyVersion(ctx context.Context, req *edgeproto.DebugRequest) string

func (*CRMData) InitHAManager

func (s *CRMData) InitHAManager(ctx context.Context, haMgr *redundancy.HighAvailabilityManager, haKey string, cloudletKey *edgeproto.CloudletKey) (bool, error)

InitHAManager returns haEnabled, error

func (*CRMData) RecvAllEnd

func (s *CRMData) RecvAllEnd(ctx context.Context)

func (*CRMData) RecvAllStart

func (s *CRMData) RecvAllStart()

func (*CRMData) RefreshAppInstRuntime

func (s *CRMData) RefreshAppInstRuntime(ctx context.Context)

func (*CRMData) StartHAManagerActiveCheck

func (s *CRMData) StartHAManagerActiveCheck(ctx context.Context, haMgr *redundancy.HighAvailabilityManager)

func (*CRMData) StartInfraResourceRefreshThread

func (s *CRMData) StartInfraResourceRefreshThread()

func (*CRMData) StartUpdateCloudletInfoHAThread

func (s *CRMData) StartUpdateCloudletInfoHAThread(ctx context.Context)

func (*CRMData) UpdateCloudletInfoAndVersionHACache

func (s *CRMData) UpdateCloudletInfoAndVersionHACache(ctx context.Context, cloudletInfo *edgeproto.CloudletInfo) error

UpdateCloudletInfoAndVersionHACache updates the value for cloudletInfo and init version that HA Manager has cached in redis

func (*CRMData) UpdateVMPool

func (cd *CRMData) UpdateVMPool(ctx context.Context, k interface{})

func (*CRMData) UpdateVMPoolInfo

func (cd *CRMData) UpdateVMPoolInfo(ctx context.Context, state edgeproto.TrackedState, errStr string)

This func must be called with cd.VMPoolMux lock held

func (*CRMData) VMPoolChanged

func (cd *CRMData) VMPoolChanged(ctx context.Context, old *edgeproto.VMPool, new *edgeproto.VMPool)

type CrmHAProcess

type CrmHAProcess struct {
	// contains filtered or unexported fields
}

func (*CrmHAProcess) ActiveChangedPostSwitch

func (s *CrmHAProcess) ActiveChangedPostSwitch(ctx context.Context, haRole string, platformActive bool) error

func (*CrmHAProcess) ActiveChangedPreSwitch

func (s *CrmHAProcess) ActiveChangedPreSwitch(ctx context.Context, haRole string, platformActive bool) error

func (*CrmHAProcess) DumpWatcherFields

func (s *CrmHAProcess) DumpWatcherFields(ctx context.Context) map[string]interface{}

func (*CrmHAProcess) PlatformActiveOnStartup

func (s *CrmHAProcess) PlatformActiveOnStartup(ctx context.Context)

type CrmMetricsReceiver

type CrmMetricsReceiver struct{}

func (*CrmMetricsReceiver) RecvMetric

func (r *CrmMetricsReceiver) RecvMetric(ctx context.Context, metric *edgeproto.Metric)

forward to controller

type EnvoyContainerVersion

type EnvoyContainerVersion struct {
	ContainerName string
	EnvoyVersion  string
	Error         string
}

type ExecReqHandler

type ExecReqHandler struct {
	// contains filtered or unexported fields
}

ExecReqHandler just satisfies the Recv() function for the ExecRequest receive notify interface, and calls into the controller data which has all the cached information about the ClusterInst, AppInst, etc.

func NewExecReqHandler

func NewExecReqHandler(cd *CRMData) *ExecReqHandler

func (*ExecReqHandler) RecvExecRequest

func (s *ExecReqHandler) RecvExecRequest(ctx context.Context, msg *edgeproto.ExecRequest)

type RootLBEnvoyVersion

type RootLBEnvoyVersion struct {
	NodeType        string
	NodeName        string
	EnvoyContainers []EnvoyContainerVersion
}

Jump to

Keyboard shortcuts

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