operator

package
v0.0.0-...-8011f81 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: BSD-3-Clause Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CassandraReconciler

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

CassandraReconciler is a controller that reconciles Cassandra resources

func NewReconciler

func NewReconciler(clusters map[types.NamespacedName]*v1alpha1.Cassandra, client client.Client, eventRecorder record.EventRecorder, eventReceiver event.Receiver, operatorConfig *Config, metricsReporter metrics.ClusterMetricsReporter) *CassandraReconciler

NewReconciler creates a CassandraReconciler

func (*CassandraReconciler) Reconcile

func (r *CassandraReconciler) Reconcile(request reconcile.Request) (reconcile.Result, error)

Reconcile implements reconcile.Reconciler Reconciliation for all watched resources is attempted in a single pass. Each request compares the current to the desired state and determines what has changed for each watched resource. Changes are calculated in one go for all watched resources so that the delta is calculated at a given point in time (as much as possible). Changes are applied one at a time without stopping on error to try bringing the cluster to the desired state as much as possible. Applying changes synchronously for a cluster while allowing concurrent updates for different clusters is made possible because the controller internal queue prevents concurrent updates for the same resource name - see https://github.com/kubernetes-sigs/controller-runtime/issues/616

type Config

type Config struct {
	MetricPollInterval    time.Duration
	MetricRequestDuration time.Duration
	ControllerSyncPeriod  time.Duration
	Namespace             string
	Version               string
	RepositoryPath        string
}

The Config for the Operator

type Interrupter

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

Interrupter is a controller whose sole purpose is to check whether any subsequent changes have been made to a cluster which is currently under modification by the Reconciler, and interrupt the Reconciler so that the newer changes can be effected.

It works by using a map of channels, keyed on a namespace-qualified cluster names, which is shared with the polling loop which waits for stateful set provisioning to complete. When the interrupter closes the channel for a cluster, the polling loop will exit early with a return value that specifies the polling was interrupted, rather than having completed successfully.

func NewInterrupter

func NewInterrupter(activeReconciliations *sync.Map, client client.Client, recorder record.EventRecorder) *Interrupter

NewInterrupter creates a new Interrupter

func (*Interrupter) Reconcile

func (i *Interrupter) Reconcile(request reconcile.Request) (reconcile.Result, error)

Reconcile checks whether the definition of the cluster referenced in the reconcile.Request has been modified, and if so, will interrupt any ongoing reconciliation that cluster.

type Operator

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

The Operator itself.

func New

func New(kubeClientset *kubernetes.Clientset, cassandraClientset *versioned.Clientset, operatorConfig *Config, kubeConfig *rest.Config) (*Operator, error)

New creates a new Operator.

func (*Operator) Run

func (o *Operator) Run()

Run starts the Operator.

type Status

type Status struct {
	// CassandraCrdVersion is the CRD version supported by this Operator
	CassandraCrdVersion string
}

Status is the top level structure containing information about this Operator and the cluster it manages

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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