controller

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: MIT Imports: 39 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterEvent added in v1.1.0

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 *rbacv1.RoleBinding
	// contains filtered or unexported fields
}

Controller represents operator controller

func NewController

func NewController(controllerConfig *spec.ControllerConfig, controllerId string) *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(namespace, name string) ([]*spec.Diff, error)

ClusterHistory dumps history of cluster changes

func (*Controller) ClusterLogs

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

ClusterLogs dumps cluster ring logs

func (*Controller) ClusterStatus

func (c *Controller) ClusterStatus(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) GetReference added in v1.6.0

func (c *Controller) GetReference(postgresql *acidv1.Postgresql) *v1.ObjectReference

GetReference of Postgres CR object i.e. required to emit events to this resource

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 added in v1.1.0

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