controller

package
v0.0.0-...-3f85c9d Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2020 License: Apache-2.0, MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterEvent

type ClusterEvent struct {
	EventTime time.Time
	UID       types.UID
	EventType EventType
	OldSpec   *acidv1.Postgresql
	NewSpec   *acidv1.Postgresql
	WorkerID  uint32
}

ClusterEvent carries the payload of the Cluster TPR events.

type Controller

type Controller struct {
	KubeClient k8sutil.KubernetesClient

	PodServiceAccount            *v1.ServiceAccount
	PodServiceAccountRoleBinding *rbacv1beta1.RoleBinding
	// contains filtered or unexported fields
}

Controller represents operator controller

func NewController

func NewController(controllerConfig *spec.ControllerConfig) *Controller

NewController creates a new controller

func (*Controller) ClusterDatabasesMap

func (c *Controller) ClusterDatabasesMap() map[string][]string

ClusterDatabasesMap returns for each cluster the list of databases running there

func (*Controller) ClusterHistory

func (c *Controller) ClusterHistory(team, namespace, name string) ([]*spec.Diff, error)

ClusterHistory dumps history of cluster changes

func (*Controller) ClusterLogs

func (c *Controller) ClusterLogs(team, namespace, name string) ([]*spec.LogEntry, error)

ClusterLogs dumps cluster ring logs

func (*Controller) ClusterStatus

func (c *Controller) ClusterStatus(team, namespace, cluster string) (*cluster.ClusterStatus, error)

ClusterStatus provides status of the cluster

func (*Controller) Fire

func (c *Controller) Fire(e *logrus.Entry) error

Fire is a logrus hook

func (*Controller) GetConfig

func (c *Controller) GetConfig() *spec.ControllerConfig

GetConfig returns controller config

func (*Controller) GetOperatorConfig

func (c *Controller) GetOperatorConfig() *config.Config

GetOperatorConfig returns operator config

func (*Controller) GetStatus

func (c *Controller) GetStatus() *spec.ControllerStatus

GetStatus dumps current config and status of the controller

func (*Controller) GetWorkersCnt

func (c *Controller) GetWorkersCnt() uint32

GetWorkersCnt returns number of the workers

func (*Controller) Levels

func (c *Controller) Levels() []logrus.Level

Levels returns logrus levels for which hook must fire

func (*Controller) ListQueue

func (c *Controller) ListQueue(workerID uint32) (*spec.QueueDump, error)

ListQueue dumps cluster event queue of the provided worker

func (*Controller) Run

func (c *Controller) Run(stopCh <-chan struct{}, wg *sync.WaitGroup)

Run starts background controller processes

func (*Controller) TeamClusterList

func (c *Controller) TeamClusterList() map[string][]spec.NamespacedName

TeamClusterList returns team-clusters map

func (*Controller) WorkerLogs

func (c *Controller) WorkerLogs(workerID uint32) ([]*spec.LogEntry, error)

WorkerLogs dumps logs of the worker

func (*Controller) WorkerStatus

func (c *Controller) WorkerStatus(workerID uint32) (*cluster.WorkerStatus, error)

WorkerStatus provides status of the worker

type EventType

type EventType string

EventType contains type of the events for the TPRs and Pods received from Kubernetes

const (
	EventAdd    EventType = "ADD"
	EventUpdate EventType = "UPDATE"
	EventDelete EventType = "DELETE"
	EventSync   EventType = "SYNC"
	EventRepair EventType = "REPAIR"
)

Possible values for the EventType

Jump to

Keyboard shortcuts

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