controllers

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: AGPL-3.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AdditionalIngressAnnotationsChangeEventReason is the reason string for firing additional ingress annotations change events.
	AdditionalIngressAnnotationsChangeEventReason = "AdditionalIngressAnnotationsChange"
	// ErrorOnAdditionalIngressAnnotationsChangeEventReason is the error string for firing additional ingress annotations change error events.
	ErrorOnAdditionalIngressAnnotationsChangeEventReason = "ErrAdditionalIngressAnnotationsChange"
)
View Source
const (
	// StartDoguEventReason is the reason string for firing start dogu events.
	StartDoguEventReason = "StartDogu"
	// ErrorOnStartDoguEventReason is the error string for firing start dogu error events.
	ErrorOnStartDoguEventReason = "ErrStartDogu"

	// StopDoguEventReason is the reason string for firing stop dogu events.
	StopDoguEventReason = "StopDogu"
	// ErrorOnStopDoguEventReason is the error string for firing stop dogu error events.
	ErrorOnStopDoguEventReason     = "ErrStopDogu"
	CheckStartedEventReason        = "CheckStarted"
	ErrorOnCheckStartedEventReason = "ErrCheckStarted"
	CheckStoppedEventReason        = "CheckStopped"
	ErrorOnCheckStoppedEventReason = "ErrCheckStopped"
)
View Source
const (
	// VolumeExpansionEventReason is the reason string for firing volume expansion events.
	VolumeExpansionEventReason = "VolumeExpansion"
	// ErrorOnVolumeExpansionEventReason is the error string for firing volume expansion error events.
	ErrorOnVolumeExpansionEventReason = "ErrVolumeExpansion"
)
View Source
const (
	InstallEventReason        = "Installation"
	ErrorOnInstallEventReason = "ErrInstallation"
)
View Source
const (
	DeinstallEventReason      = "Deinstallation"
	ErrorDeinstallEventReason = "ErrDeinstallation"
)
View Source
const (
	SupportEventReason        = "Support"
	ErrorOnSupportEventReason = "ErrSupport"
)
View Source
const (
	RequeueEventReason        = "Requeue"
	ErrorOnRequeueEventReason = "ErrRequeue"
)
View Source
const (
	FailedNameValidationEventReason              = "FailedNameValidation"
	FailedVolumeSizeParsingValidationEventReason = "FailedVolumeSizeParsingValidation"
	FailedVolumeSizeSIValidationEventReason      = "FailedVolumeSizeSIValidation"
)
View Source
const (
	Install                            = operation("Install")
	Upgrade                            = operation("Upgrade")
	Delete                             = operation("Delete")
	Wait                               = operation("Wait")
	ExpandVolume                       = operation("ExpandVolume")
	ChangeAdditionalIngressAnnotations = operation("ChangeAdditionalIngressAnnotations")
	StartDogu                          = operation("StartDogu")
	StopDogu                           = operation("StopDogu")
	CheckStarted                       = operation("CheckStarted")
	CheckStopped                       = operation("CheckStopped")
)
View Source
const SupportModeEnvVar = "SUPPORT_MODE"

Variables

View Source
var NewManager = NewDoguManager

NewManager is an alias mainly used for testing the main package

Functions

func NewDoguAdditionalIngressAnnotationsManager

func NewDoguAdditionalIngressAnnotationsManager(client client.Client, eventRecorder record.EventRecorder) *doguAdditionalIngressAnnotationsManager

NewDoguAdditionalIngressAnnotationsManager creates a new instance of a manager to append ingress annotations to a dogu service.

func NewDoguDeleteManager

func NewDoguDeleteManager(
	client client.Client,
	operatorConfig *config.OperatorConfig,
	mgrSet *util.ManagerSet,
	recorder record.EventRecorder,
	configRepos util.ConfigRepositories,
) *doguDeleteManager

NewDoguDeleteManager creates a new instance of doguDeleteManager.

func NewDoguInstallManager

func NewDoguInstallManager(client client.Client, mgrSet *util.ManagerSet, eventRecorder record.EventRecorder, configRepos util.ConfigRepositories) *doguInstallManager

NewDoguInstallManager creates a new instance of doguInstallManager.

func NewDoguReconciler

func NewDoguReconciler(client client.Client, doguInterface ecoSystem.DoguInterface, doguManager CombinedDoguManager, eventRecorder record.EventRecorder, namespace string, doguFetcher localDoguFetcher) (*doguReconciler, error)

NewDoguReconciler creates a new reconciler instance for the dogu resource

func NewDoguRequeueHandler

func NewDoguRequeueHandler(doguInterface ecoSystem.DoguInterface, recorder record.EventRecorder, namespace string) (*doguRequeueHandler, error)

NewDoguRequeueHandler creates a new dogu requeue handler.

func NewDoguSupportManager

func NewDoguSupportManager(client client.Client, mgrSet *util.ManagerSet, eventRecorder record.EventRecorder) *doguSupportManager

NewDoguSupportManager creates a new instance of doguSupportManager.

func NewDoguUpgradeManager

func NewDoguUpgradeManager(client client.Client, mgrSet *util.ManagerSet, eventRecorder record.EventRecorder) *doguUpgradeManager

NewDoguUpgradeManager creates a new instance of doguUpgradeManager which handles dogu upgrades.

func NewDoguVolumeManager

func NewDoguVolumeManager(client client.Client, eventRecorder record.EventRecorder) *doguVolumeManager

NewDoguVolumeManager creates a new instance of the doguVolumeManager.

Types

type ClientSet

type ClientSet interface {
	kubernetes.Interface
}

type CombinedDoguManager

type CombinedDoguManager interface {
	// contains filtered or unexported methods
}

CombinedDoguManager abstracts the simple dogu operations in a k8s CES.

type DeploymentReconciler

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

DeploymentReconciler watches every Deployment object in the cluster and writes the state of dogus into their respective custom resources.

func NewDeploymentReconciler

func NewDeploymentReconciler(k8sClientSet ClientSet, availabilityChecker *health.AvailabilityChecker,
	doguHealthStatusUpdater health.DoguHealthStatusUpdater, doguFetcher localDoguFetcher) *DeploymentReconciler

func (*DeploymentReconciler) Reconcile

func (dr *DeploymentReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*DeploymentReconciler) SetupWithManager

func (dr *DeploymentReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type DoguManager

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

DoguManager is a central unit in the process of handling dogu custom resources The DoguManager creates, updates and deletes dogus

func NewDoguManager

func NewDoguManager(client client.Client, ecosystemClient ecoSystem.EcoSystemV2Interface, operatorConfig *config.OperatorConfig, eventRecorder record.EventRecorder) (*DoguManager, error)

NewDoguManager creates a new instance of DoguManager

func (*DoguManager) CheckStarted

func (m *DoguManager) CheckStarted(ctx context.Context, doguResource *k8sv2.Dogu) error

func (*DoguManager) CheckStopped

func (m *DoguManager) CheckStopped(ctx context.Context, doguResource *k8sv2.Dogu) error

func (*DoguManager) Delete

func (m *DoguManager) Delete(ctx context.Context, doguResource *k8sv2.Dogu) error

Delete deletes a dogu resource.

func (*DoguManager) HandleSupportMode

func (m *DoguManager) HandleSupportMode(ctx context.Context, doguResource *k8sv2.Dogu) (bool, error)

HandleSupportMode handles the support flag in the dogu spec.

func (*DoguManager) Install

func (m *DoguManager) Install(ctx context.Context, doguResource *k8sv2.Dogu) error

Install installs a dogu resource.

func (*DoguManager) SetDoguAdditionalIngressAnnotations

func (m *DoguManager) SetDoguAdditionalIngressAnnotations(ctx context.Context, doguResource *k8sv2.Dogu) error

SetDoguAdditionalIngressAnnotations edits the additional ingress annotations in the given dogu's service.

func (*DoguManager) SetDoguDataVolumeSize

func (m *DoguManager) SetDoguDataVolumeSize(ctx context.Context, doguResource *k8sv2.Dogu) error

SetDoguDataVolumeSize sets the dataVolumeSize from the dogu resource to the data PVC from the dogu.

func (*DoguManager) StartDogu

func (m *DoguManager) StartDogu(ctx context.Context, doguResource *k8sv2.Dogu) error

StartDogu scales a stopped dogu to 1.

func (*DoguManager) StopDogu

func (m *DoguManager) StopDogu(ctx context.Context, doguResource *k8sv2.Dogu) error

StopDogu scales a running dogu to 0.

func (*DoguManager) Upgrade

func (m *DoguManager) Upgrade(ctx context.Context, doguResource *k8sv2.Dogu) error

Upgrade upgrades a dogu resource.

type DoguRestartGarbageCollector

type DoguRestartGarbageCollector interface {
	DoGarbageCollection(ctx context.Context, doguName string) error
}

type DoguRestartReconciler

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

DoguRestartReconciler reconciles a DoguRestart object

func NewDoguRestartReconciler

func NewDoguRestartReconciler(doguRestartInterface ecoSystem.DoguRestartInterface, doguInterface ecoSystem.DoguInterface, recorder record.EventRecorder, gc DoguRestartGarbageCollector) *DoguRestartReconciler

func (*DoguRestartReconciler) Reconcile

func (r *DoguRestartReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.4/pkg/reconcile

func (*DoguRestartReconciler) SetupWithManager

func (r *DoguRestartReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type DoguStartStopManager

type DoguStartStopManager interface {
	// contains filtered or unexported methods
}

DoguStartStopManager includes functionality to start and stop dogus.

type K8sClient

type K8sClient interface {
	client.Client
}

type RestartOperation

type RestartOperation string

func RestartOperationFromRestartStatusPhase

func RestartOperationFromRestartStatusPhase(phase k8sv2.RestartStatusPhase) RestartOperation

Jump to

Keyboard shortcuts

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