controllers

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 57 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRequeueAfterTimeInSec = 20
	BrokerCapacityDisk           = "DISK"
	BrokerCapacity               = "capacity"
)

Variables

This section is empty.

Functions

func IsExpired added in v0.22.0

func IsExpired(ttl time.Duration, finishedAt time.Time) bool

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 SetupCruiseControlOperationTTLWithManager added in v0.22.0

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

SetupCruiseControlWithManager registers cruise control operation controller to the manager

func SetupCruiseControlOperationWithManager added in v0.22.0

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

SetupCruiseControlWithManager registers cruise control controller to the manager

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, certManagerEnabled 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 CruiseControlOperationReconciler added in v0.22.0

type CruiseControlOperationReconciler struct {
	client.Client
	DirectClient client.Reader
	Scheme       *runtime.Scheme

	ScaleFactory func(ctx context.Context, kafkaCluster *banzaiv1beta1.KafkaCluster) (scale.CruiseControlScaler, error)
	// contains filtered or unexported fields
}

CruiseControlOperationReconciler reconciles CruiseControlOperation custom resources

func (*CruiseControlOperationReconciler) Reconcile added in v0.22.0

type CruiseControlOperationTTLReconciler added in v0.22.0

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

CruiseControlOperationTTLReconciler reconciles CruiseControlOperation custom resources

func (*CruiseControlOperationTTLReconciler) Reconcile added in v0.22.0

type CruiseControlTask added in v0.21.0

type CruiseControlTask struct {
	BrokerID                        string
	BrokerState                     koperatorv1beta1.CruiseControlState
	Volume                          string
	VolumeState                     koperatorv1beta1.CruiseControlVolumeState
	Operation                       koperatorv1alpha1.CruiseControlTaskOperation
	CruiseControlOperationReference *corev1.LocalObjectReference
}

CruiseControlTask defines a task to be performed via Cruise Control.

func (*CruiseControlTask) Apply added in v0.21.0

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

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

func (*CruiseControlTask) FromResult added in v0.21.0

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

func (*CruiseControlTask) IsRequired added in v0.22.0

func (t *CruiseControlTask) IsRequired() bool

IsRequired returns true if the task needs to be executed.

func (*CruiseControlTask) SetCruiseControlOperationRef added in v0.22.0

func (t *CruiseControlTask) SetCruiseControlOperationRef(ref corev1.LocalObjectReference)

func (*CruiseControlTask) SetStateScheduled added in v0.22.0

func (t *CruiseControlTask) SetStateScheduled()

type CruiseControlTaskReconciler

type CruiseControlTaskReconciler struct {
	client.Client
	// DirectClient here is needed because when the next reconciliation is happened instantly after status update then
	// the changes in some cases will not be in the resource otherwise.
	DirectClient client.Reader
	Scheme       *runtime.Scheme
	ScaleFactory func(ctx context.Context, kafkaCluster *banzaiv1beta1.KafkaCluster) (scale.CruiseControlScaler, error)
}

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 banzaiv1beta1.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

NumActiveTasksByOp the number of active CruiseControlTask instances stored.

func (*CruiseControlTasksAndStates) SyncState added in v0.21.0

SyncState makes sure that the status of the provided koperatorv1beta1.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

Directories

Path Synopsis
tests
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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