controllermanager

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	UniqueResourceNameSeparator = "-"
)

Variables

This section is empty.

Functions

func DaemonsetReportStatusDeserialize

func DaemonsetReportStatusDeserialize(b []byte) (*reporter.DaemonsetResourceStatus, error)

DaemonsetReportStatusDeserialize deserialize byte data to DaemonsetResourceStatus.

func DeploymentReportStatusDeserialize

func DeploymentReportStatusDeserialize(b []byte) (*reporter.DeploymentResourceStatus, error)

DeploymentReportStatusDeserialize deserialize byte data to DeploymentResourceStatus.

func EventReportStatusDeserialize

func EventReportStatusDeserialize(b []byte) (*reporter.EventResourceStatus, error)

EventReportStatusDeserialize deserialize byte data to EventResourceStatus.

func NodeReportStatusDeserialize

func NodeReportStatusDeserialize(b []byte) (*reporter.NodeResourceStatus, error)

NodeReportStatusDeserialize deserialize byte data to NodeReportStatus.

func PodReportStatusDeserialize

func PodReportStatusDeserialize(b []byte) (*reporter.PodResourceStatus, error)

PodReportStatusDeserialize deserialize byte data to PodReportStatus.

func ReportDeserialize

func ReportDeserialize(b []byte) ([]reporter.Report, error)

ReportDeserialize deserialize byte data to report slice.

func ServiceReportStatusDeserialize

func ServiceReportStatusDeserialize(b []byte) (*reporter.ServiceResourceStatus, error)

ServiceReportStatusDeserialize deserialize byte data to ServiceResourceStatus.

func UniqueResourceName

func UniqueResourceName(obj *metav1.ObjectMeta) error

UniqueResourceName returns unique resource name.

Types

type ControllerContext

type ControllerContext struct {
	K8sContext

	// a channel to publish msg to root cluster controller
	PublishChan chan clustermessage.ClusterMessage

	//StopChan is the stop channel
	StopChan <-chan struct{}
	// contains filtered or unexported fields
}

ControllerContext is the context needed by all controllers. ControllerContext woubld be a param when start a controller.

type InitFunc

type InitFunc func(ctx *ControllerContext) error

InitFunc is the function to start a controller within a context.

type K8sContext

type K8sContext struct {
	OteClient          oteclient.Interface
	OteInformerFactory oteinformer.SharedInformerFactory

	K8sClient       kubernetes.Interface
	InformerFactory informers.SharedInformerFactory
}

K8sContext is the context of all object related to k8s.

type UpstreamProcessor

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

UpstreamProcessor processes msg from root cluster controller.

func NewUpstreamProcessor

func NewUpstreamProcessor(ctx *K8sContext) *UpstreamProcessor

NewUpstreamProcessor new a UpstreamProcessor with k8s context.

func (*UpstreamProcessor) CenterCreateEvent

func (u *UpstreamProcessor) CenterCreateEvent(updateMap map[string]*corev1.Event)

CenterCreateEvent handles event resource created from edge clusters.

func (*UpstreamProcessor) CenterDeleteEvent

func (u *UpstreamProcessor) CenterDeleteEvent(delMap map[string]*corev1.Event)

CenterDeleteEvent handles event resource deleted from edge clusters.

func (*UpstreamProcessor) CreateDaemonset

func (u *UpstreamProcessor) CreateDaemonset(daemonset *appsv1.DaemonSet) error

CreateDaemonset creates daemonset resource from edge cluster to center etcd.

func (*UpstreamProcessor) CreateDeployment

func (u *UpstreamProcessor) CreateDeployment(deployment *appsv1.Deployment) error

CreateDeployment creates deployment resource from edge cluster to center etcd.

func (*UpstreamProcessor) CreateEvent

func (u *UpstreamProcessor) CreateEvent(event *corev1.Event) error

CreateEvent creates event resource from edge cluster to center etcd.

func (*UpstreamProcessor) CreateNode

func (u *UpstreamProcessor) CreateNode(node *corev1.Node) error

CreateNode will create the given node.

func (*UpstreamProcessor) CreateOrUpdateDaemonset

func (u *UpstreamProcessor) CreateOrUpdateDaemonset(daemonset *appsv1.DaemonSet) error

CreateOrUpdateDaemonset checks whether daemonset exists,then creates or updates it to center etcd.

func (*UpstreamProcessor) CreateOrUpdateDeployment

func (u *UpstreamProcessor) CreateOrUpdateDeployment(deployment *appsv1.Deployment) error

CreateOrUpdateDeployment checks whether deployment exists,then creates or updates it to center etcd.

func (*UpstreamProcessor) CreateOrUpdateNode

func (u *UpstreamProcessor) CreateOrUpdateNode(node *corev1.Node) error

CreateOrUpdateNode will update the given node or create it if does not exist.

func (*UpstreamProcessor) CreateOrUpdatePod

func (u *UpstreamProcessor) CreateOrUpdatePod(pod *corev1.Pod) error

CreateOrUpdatePod will update the given pod or create it if does not exist.

func (*UpstreamProcessor) CreateOrUpdateService

func (u *UpstreamProcessor) CreateOrUpdateService(service *corev1.Service) error

CreateOrUpdateService checks whether service exists,then creates or updates it to center etcd.

func (*UpstreamProcessor) CreatePod

func (u *UpstreamProcessor) CreatePod(pod *corev1.Pod) error

CreatePod will create the given pod.

func (*UpstreamProcessor) CreateService

func (u *UpstreamProcessor) CreateService(service *corev1.Service) error

CreateService creates service resource from edge cluster to center etcd.

func (*UpstreamProcessor) DeleteDaemonset

func (u *UpstreamProcessor) DeleteDaemonset(daemonset *appsv1.DaemonSet) error

DeleteDaemonset deletes daemonset resource reported from edge cluster.

func (*UpstreamProcessor) DeleteDeployment

func (u *UpstreamProcessor) DeleteDeployment(deployment *appsv1.Deployment) error

DeleteDeployment deletes deployment resource reported from edge cluster.

func (*UpstreamProcessor) DeleteEvent

func (u *UpstreamProcessor) DeleteEvent(event *corev1.Event) error

DeleteEvent deletes event resource reported from edge cluster.

func (*UpstreamProcessor) DeleteNode

func (u *UpstreamProcessor) DeleteNode(node *corev1.Node) error

DeleteNode will delete the given node.

func (*UpstreamProcessor) DeletePod

func (u *UpstreamProcessor) DeletePod(pod *corev1.Pod) error

DeletePod will delete the given pod.

func (*UpstreamProcessor) DeleteService

func (u *UpstreamProcessor) DeleteService(service *corev1.Service) error

DeleteService deletes service resource reported from edge cluster.

func (*UpstreamProcessor) GetDaemonset

func (u *UpstreamProcessor) GetDaemonset(daemonset *appsv1.DaemonSet) (*appsv1.DaemonSet, error)

GetDaemonset get daemonset resource stored in center etcd.

func (*UpstreamProcessor) GetDeployment

func (u *UpstreamProcessor) GetDeployment(deployment *appsv1.Deployment) (*appsv1.Deployment, error)

GetDeployment get deployment resource stored in center etcd.

func (*UpstreamProcessor) GetNode

func (u *UpstreamProcessor) GetNode(node *corev1.Node) (*corev1.Node, error)

GetNode will retrieve the requested node based on name.

func (*UpstreamProcessor) GetPod

func (u *UpstreamProcessor) GetPod(pod *corev1.Pod) (*corev1.Pod, error)

GetPod will retrieve the requested pod based on namespace and name.

func (*UpstreamProcessor) GetService

func (u *UpstreamProcessor) GetService(service *corev1.Service) (*corev1.Service, error)

GetService get service resource stored in center etcd.

func (*UpstreamProcessor) HandleReceivedMessage

func (u *UpstreamProcessor) HandleReceivedMessage(client string, data []byte) (ret error)

HandleReceivedMessage processes msg from root cluster controller. This function should be registed to controller tunnel.

func (*UpstreamProcessor) UpdateClusterStatus

func (u *UpstreamProcessor) UpdateClusterStatus(clustername string, status *otev1.ClusterStatus) error

UpdateClusterStatus update status of the given cluster.

func (*UpstreamProcessor) UpdateDaemonset

func (u *UpstreamProcessor) UpdateDaemonset(daemonset *appsv1.DaemonSet) error

UpdateDaemonset updates daemonset resource from edge cluster to center etcd.

func (*UpstreamProcessor) UpdateDeployment

func (u *UpstreamProcessor) UpdateDeployment(deployment *appsv1.Deployment) error

UpdateDeployment updates deployment resource from edge cluster to center etcd.

func (*UpstreamProcessor) UpdateNode

func (u *UpstreamProcessor) UpdateNode(node *corev1.Node) error

UpdateNode will update the given node.

func (*UpstreamProcessor) UpdatePod

func (u *UpstreamProcessor) UpdatePod(pod *corev1.Pod) error

UpdatePod will update the given pod.

func (*UpstreamProcessor) UpdateService

func (u *UpstreamProcessor) UpdateService(service *corev1.Service) error

UpdateService updates service resource from edge cluster to center etcd.

Jump to

Keyboard shortcuts

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