controllers

package
v0.22.0-dev.3 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRequeueAfterTimeInSec = 20
)

Variables

This section is empty.

Functions

func SetAlertManagerWithManager

func SetAlertManagerWithManager(mgr manager.Manager) error

SetAlertManagerWithManager creates a new Alertmanager Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller and Start it when the Manager is Started.

func SetNewKafkaFromCluster

func SetNewKafkaFromCluster(f func(k8sclient client.Client, cluster *v1beta1.KafkaCluster) (kafkaclient.KafkaClient, func(), error))

func SetupCruiseControlWithManager

func SetupCruiseControlWithManager(mgr ctrl.Manager) *ctrl.Builder

SetupCruiseControlWithManager registers cruise control controller to the manager

func SetupKafkaClusterWithManager

func SetupKafkaClusterWithManager(mgr ctrl.Manager) *ctrl.Builder

SetupKafkaClusterWithManager registers kafka cluster controller to the manager

func SetupKafkaTopicWithManager

func SetupKafkaTopicWithManager(mgr ctrl.Manager, maxConcurrentReconciles int) *ctrl.Builder

SetupKafkaTopicWithManager registers kafka topic controller with manager

func SetupKafkaUserWithManager

func SetupKafkaUserWithManager(mgr ctrl.Manager, certSigningEnabled bool, certManagerNamespace bool) *ctrl.Builder

SetupKafkaUserWithManager registers KafkaUser controller to the manager

Types

type AController

type AController struct {
	Client client.Client
}

AController implements Runnable

func (AController) Start

func (c AController) Start(ctx context.Context) error

Start initiates the alertmanager controller

type CruiseControlOperation added in v0.21.0

type CruiseControlOperation int8
const (
	OperationAddBroker CruiseControlOperation = iota
	OperationRemoveBroker
	OperationRebalanceDisks
)

type CruiseControlTask added in v0.21.0

type CruiseControlTask struct {
	TaskID    string
	StartedAt string

	BrokerID    string
	BrokerState kafkav1beta1.CruiseControlState

	Volume      string
	VolumeState kafkav1beta1.CruiseControlVolumeState

	Err       string
	Operation CruiseControlOperation
}

CruiseControlTask defines a task to be performed via Cruise Control.

func (*CruiseControlTask) Apply added in v0.21.0

func (t *CruiseControlTask) Apply(instance *kafkav1beta1.KafkaCluster)

Apply takes a kafkav1beta1.KafkaCluster instance and updates its Status field to reflect the state of the task.

func (*CruiseControlTask) FromResult added in v0.21.0

func (t *CruiseControlTask) FromResult(result *scale.Result)

FromResult takes a scale.Result instance returned by scale.CruiseControlScaler and updates its own state accordingly.

func (*CruiseControlTask) IsDone added in v0.21.0

func (t *CruiseControlTask) IsDone() bool

IsDone returns true if the task is considered finished.

type CruiseControlTaskReconciler

type CruiseControlTaskReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

CruiseControlTaskReconciler reconciles a kafka cluster object

func (*CruiseControlTaskReconciler) Reconcile

func (r *CruiseControlTaskReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error)

func (*CruiseControlTaskReconciler) UpdateStatus added in v0.21.0

UpdateStatus updates the Status of the provided kafkav1beta1.KafkaCluster instance with the status of the tasks from a CruiseControlTasksAndStates and sends the updates to the Kubernetes API if any changes in the Status field is detected. Otherwise, this step is skipped.

type CruiseControlTasksAndStates added in v0.21.0

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

CruiseControlTasksAndStates is a container for CruiseControlTask objects.

func (*CruiseControlTasksAndStates) Add added in v0.21.0

Add registers the provided CruiseControlTask instance.

func (*CruiseControlTasksAndStates) GetActiveTasksByOp added in v0.21.0

GetActiveTasksByOp returns a list of active CruiseControlTask filtered by the provided CruiseControlOperation type.

func (CruiseControlTasksAndStates) IsEmpty added in v0.21.0

func (s CruiseControlTasksAndStates) IsEmpty() bool

IsEmpty returns true if CruiseControlTasksAndStates has no CruiseControlTask added.

func (*CruiseControlTasksAndStates) NumActiveTasksByOp added in v0.21.0

func (s *CruiseControlTasksAndStates) NumActiveTasksByOp(o CruiseControlOperation) int

NumActiveTasksByOp the number of active CruiseControlTask instances stored.

func (*CruiseControlTasksAndStates) SyncState added in v0.21.0

func (s *CruiseControlTasksAndStates) SyncState(instance *kafkav1beta1.KafkaCluster)

SyncState makes sure that the status of the provided kafkav1beta1.KafkaCluster reflects the state of the CruiseControlTask instances.

type KafkaClusterReconciler

type KafkaClusterReconciler struct {
	client.Client
	DirectClient        client.Reader
	Namespaces          []string
	KafkaClientProvider kafkaclient.Provider
}

KafkaClusterReconciler reconciles a KafkaCluster object

func (*KafkaClusterReconciler) Reconcile

func (r *KafkaClusterReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error)

type KafkaTopicReconciler

type KafkaTopicReconciler struct {
	// This client, initialized using mgr.Client() above, is a split client
	// that reads objects from the cache and writes to the apiserver
	Client client.Client
	Scheme *runtime.Scheme
}

KafkaTopicReconciler reconciles a KafkaTopic object

func (*KafkaTopicReconciler) Reconcile

Reconcile reconciles the kafka topic

type KafkaUserReconciler

type KafkaUserReconciler struct {
	// This client, initialized using mgr.Client() above, is a split client
	// that reads objects from the cache and writes to the apiserver
	Client client.Client
	Scheme *runtime.Scheme
}

KafkaUserReconciler reconciles a KafkaUser object

func (*KafkaUserReconciler) Reconcile

func (r *KafkaUserReconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)

Reconcile reads that state of the cluster for a KafkaUser object and makes changes based on the state read and what is in the KafkaUser.Spec

type SkipClusterRegistryOwnedResourcePredicate added in v0.21.0

type SkipClusterRegistryOwnedResourcePredicate struct{}

SkipClusterRegistryOwnedResourcePredicate returns a controller event filter that filters out events triggered by Cluster Registry owned resources

func (SkipClusterRegistryOwnedResourcePredicate) Create added in v0.21.0

func (SkipClusterRegistryOwnedResourcePredicate) Delete added in v0.21.0

func (SkipClusterRegistryOwnedResourcePredicate) Generic added in v0.21.0

func (SkipClusterRegistryOwnedResourcePredicate) Update added in v0.21.0

Jump to

Keyboard shortcuts

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