chi

package
v0.0.0-...-bbbf66a Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 53 Imported by: 1

Documentation

Index

Constants

View Source
const FinalizerName = "finalizer.clickhouseinstallation.altinity.com"

FinalizerName specifies name of the finalizer to be used with CHI

Variables

View Source
var (
	// ErrOperatorPodNotSpecified specifies error when there is not namespace/name pair provided pointing to operator pod
	ErrOperatorPodNotSpecified = fmt.Errorf("operator pod not specfied")
)

Functions

func NewDropReplicaOptionsArr

func NewDropReplicaOptionsArr(opts ...*dropReplicaOptions) (res dropReplicaOptionsArr)

NewDropReplicaOptionsArr creates new dropReplicaOptions array

func NewMigrateTableOptionsArr

func NewMigrateTableOptionsArr(opts ...*migrateTableOptions) (res migrateTableOptionsArr)

NewMigrateTableOptionsArr creates new migrateTableOptions array

func NewReconcileHostStatefulSetOptionsArr

func NewReconcileHostStatefulSetOptionsArr(opts ...*reconcileHostStatefulSetOptions) (res reconcileHostStatefulSetOptionsArr)

NewReconcileHostStatefulSetOptionsArr creates new reconcileHostStatefulSetOptions array

Types

type Announcer

type Announcer struct {
	a.Announcer
	// contains filtered or unexported fields
}

Announcer handler all log/event/status messages going outside of controller/worker

func NewAnnouncer

func NewAnnouncer() Announcer

NewAnnouncer creates new announcer

func (Announcer) A

func (a Announcer) A() Announcer

A adds full code address as 'file:line:function'

func (Announcer) E

func (a Announcer) E() Announcer

E adds 'end of the function' tag

func (Announcer) Error

func (a Announcer) Error(format string, args ...interface{})

Error is inspired by log.Errorf()

func (Announcer) F

func (a Announcer) F() Announcer

F adds function name

func (Announcer) FL

func (a Announcer) FL() Announcer

FL adds filename

func (Announcer) Fatal

func (a Announcer) Fatal(format string, args ...interface{})

Fatal is inspired by log.Fatalf()

func (Announcer) Info

func (a Announcer) Info(format string, args ...interface{})

Info is inspired by log.Infof()

func (Announcer) L

func (a Announcer) L() Announcer

L adds line number

func (Announcer) M

func (a Announcer) M(m ...interface{}) Announcer

M adds object meta as 'namespace/name'

func (Announcer) P

func (a Announcer) P()

P triggers log to print line

func (Announcer) S

func (a Announcer) S() Announcer

S adds 'start of the function' tag

func (Announcer) Silence

func (a Announcer) Silence() Announcer

Silence produces silent announcer

func (Announcer) V

func (a Announcer) V(level log.Level) Announcer

V is inspired by log.V()

func (Announcer) Warning

func (a Announcer) Warning(format string, args ...interface{})

Warning is inspired by log.Warningf()

func (Announcer) WithController

func (a Announcer) WithController(ctrl *Controller) Announcer

WithController specifies controller to be used in case `chi`-related announces need to be done

func (Announcer) WithEvent

func (a Announcer) WithEvent(
	chi *api.ClickHouseInstallation,
	action string,
	reason string,
) Announcer

WithEvent is used in chained calls in order to produce event into `chi`

func (Announcer) WithStatusAction

func (a Announcer) WithStatusAction(chi *api.ClickHouseInstallation) Announcer

WithStatusAction is used in chained calls in order to produce action into `ClickHouseInstallation.Status.Action`

func (Announcer) WithStatusActions

func (a Announcer) WithStatusActions(chi *api.ClickHouseInstallation) Announcer

WithStatusActions is used in chained calls in order to produce action in ClickHouseInstallation.Status.Actions

func (Announcer) WithStatusError

func (a Announcer) WithStatusError(chi *api.ClickHouseInstallation) Announcer

WithStatusError is used in chained calls in order to produce error in ClickHouseInstallation.Status.Error

type Controller

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

Controller defines CRO controller

func NewController

func NewController(
	chopClient chopClientSet.Interface,
	extClient apiExtensions.Interface,
	kubeClient kube.Interface,
	chopInformerFactory chopInformers.SharedInformerFactory,
	kubeInformerFactory kubeInformers.SharedInformerFactory,
) *Controller

NewController creates instance of Controller

func (*Controller) EventError

func (c *Controller) EventError(
	chi *api.ClickHouseInstallation,
	action string,
	reason string,
	message string,
)

EventError emits event Error

func (*Controller) EventInfo

func (c *Controller) EventInfo(
	chi *api.ClickHouseInstallation,
	action string,
	reason string,
	message string,
)

EventInfo emits event Info

func (*Controller) EventWarning

func (c *Controller) EventWarning(
	chi *api.ClickHouseInstallation,
	action string,
	reason string,
	message string,
)

EventWarning emits event Warning

func (*Controller) GetCHIByObjectMeta

func (c *Controller) GetCHIByObjectMeta(objectMeta *meta.ObjectMeta, isCHI bool) (*api.ClickHouseInstallation, error)

GetCHIByObjectMeta gets CHI by namespaced name

func (*Controller) Run

func (c *Controller) Run(ctx context.Context)

Run syncs caches, starts workers

type DropDns

type DropDns struct {
	PriorityQueueItem
	// contains filtered or unexported fields
}

DropDns specifies drop dns queue item

func NewDropDns

func NewDropDns(initiator *meta.ObjectMeta) *DropDns

NewDropDns creates new drop dns queue item

func (DropDns) Handle

func (r DropDns) Handle() queue.T

Handle returns handle of the queue item

type ErrorCRUD

type ErrorCRUD error

ErrorCRUD specifies errors of the CRUD operations

type ErrorDataPersistence

type ErrorDataPersistence error

ErrorDataPersistence specifies errors of the PVCs and PVs

type Metrics

type Metrics struct {
	// CHIReconcilesStarted is a number (counter) of started CHI reconciles
	CHIReconcilesStarted metric.Int64Counter
	// CHIReconcilesCompleted is a number (counter) of completed CHI reconciles.
	// In ideal world number of completed reconciles should be equal to CHIReconcilesStarted
	CHIReconcilesCompleted metric.Int64Counter
	// CHIReconcilesAborted is a number (counter) of explicitly aborted CHI reconciles.
	// This counter does not includes reconciles that we not completed due to external rasons, such as operator restart
	CHIReconcilesAborted metric.Int64Counter
	// CHIReconcilesTimings is a histogram of durations of successfully completed CHI reconciles
	CHIReconcilesTimings metric.Float64Histogram

	// HostReconcilesStarted is a number (counter) of started host reconciles
	HostReconcilesStarted metric.Int64Counter
	// HostReconcilesCompleted is a number (counter) of completed host reconciles.
	// In ideal world number of completed reconciles should be equal to HostReconcilesStarted
	HostReconcilesCompleted metric.Int64Counter
	// HostReconcilesRestarts is a number (counter) of host restarts during reconcile
	HostReconcilesRestarts metric.Int64Counter
	// HostReconcilesErrors is a number (counter) of failed (non-completed) host reconciles.
	HostReconcilesErrors metric.Int64Counter
	// HostReconcilesTimings is a histogram of durations of successfully completed host reconciles
	HostReconcilesTimings metric.Float64Histogram

	PodAddEvents    metric.Int64Counter
	PodUpdateEvents metric.Int64Counter
	PodDeleteEvents metric.Int64Counter
}

Metrics is a set of metrics that are tracked by the operator

type PriorityQueueItem

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

PriorityQueueItem specifies item of the priority queue

func (PriorityQueueItem) Priority

func (i PriorityQueueItem) Priority() int

Priority gets priority of the queue item

type ReconcileCHI

type ReconcileCHI struct {
	PriorityQueueItem
	// contains filtered or unexported fields
}

ReconcileCHI specifies reconcile request queue item

func NewReconcileCHI

func NewReconcileCHI(cmd string, old, new *api.ClickHouseInstallation) *ReconcileCHI

NewReconcileCHI creates new reconcile request queue item

func (ReconcileCHI) Handle

func (r ReconcileCHI) Handle() queue.T

Handle returns handle of the queue item

type ReconcileCHIT

type ReconcileCHIT struct {
	PriorityQueueItem
	// contains filtered or unexported fields
}

ReconcileCHIT specifies reconcile CHI template queue item

func NewReconcileCHIT

func NewReconcileCHIT(cmd string, old, new *api.ClickHouseInstallationTemplate) *ReconcileCHIT

NewReconcileCHIT creates new reconcile CHI template queue item

func (ReconcileCHIT) Handle

func (r ReconcileCHIT) Handle() queue.T

Handle returns handle of the queue item

type ReconcileChopConfig

type ReconcileChopConfig struct {
	PriorityQueueItem
	// contains filtered or unexported fields
}

ReconcileChopConfig specifies CHOp config queue item

func NewReconcileChopConfig

func NewReconcileChopConfig(cmd string, old, new *api.ClickHouseOperatorConfiguration) *ReconcileChopConfig

NewReconcileChopConfig creates new CHOp config queue item

func (ReconcileChopConfig) Handle

func (r ReconcileChopConfig) Handle() queue.T

Handle returns handle of the queue item

type ReconcileEndpoints

type ReconcileEndpoints struct {
	PriorityQueueItem
	// contains filtered or unexported fields
}

ReconcileEndpoints specifies endpoint

func NewReconcileEndpoints

func NewReconcileEndpoints(cmd string, old, new *core.Endpoints) *ReconcileEndpoints

NewReconcileEndpoints creates new reconcile endpoints queue item

func (ReconcileEndpoints) Handle

func (r ReconcileEndpoints) Handle() queue.T

Handle returns handle of the queue item

type ReconcilePod

type ReconcilePod struct {
	PriorityQueueItem
	// contains filtered or unexported fields
}

ReconcilePod specifies pod reconcile

func NewReconcilePod

func NewReconcilePod(cmd string, old, new *core.Pod) *ReconcilePod

NewReconcilePod creates new reconcile endpoints queue item

func (ReconcilePod) Handle

func (r ReconcilePod) Handle() queue.T

Handle returns handle of the queue item

type ReconcileShardsAndHostsOptions

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

ReconcileShardsAndHostsOptions is and options for reconciler

func (*ReconcileShardsAndHostsOptions) FullFanOut

func (o *ReconcileShardsAndHostsOptions) FullFanOut() bool

FullFanOut gets value

type ReconcileShardsAndHostsOptionsCtxKeyType

type ReconcileShardsAndHostsOptionsCtxKeyType string

ReconcileShardsAndHostsOptionsCtxKeyType specifies type for ReconcileShardsAndHostsOptionsCtxKey More details here on why do we need special type https://stackoverflow.com/questions/40891345/fix-should-not-use-basic-type-string-as-key-in-context-withvalue-golint

const ReconcileShardsAndHostsOptionsCtxKey ReconcileShardsAndHostsOptionsCtxKeyType = "ReconcileShardsAndHostsOptions"

ReconcileShardsAndHostsOptionsCtxKey specifies name of the key to be used for ReconcileShardsAndHostsOptions

type UpdateCHIStatusOptions

type UpdateCHIStatusOptions struct {
	api.CopyCHIStatusOptions
	TolerateAbsence bool
}

UpdateCHIStatusOptions defines how to update CHI status

Jump to

Keyboard shortcuts

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