controllers

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndSetProcessStatus added in v0.24.0

func CheckAndSetProcessStatus(r *FoundationDBClusterReconciler, cluster *fdbtypes.FoundationDBCluster, instance FdbInstance, processMap map[string][]fdbtypes.FoundationDBStatusProcessInfo, processNumber int, processCount int, processGroupStatus *fdbtypes.ProcessGroupStatus) error

CheckAndSetProcessStatus checks the status of the Process and if missing or incorrect add it to the related status field

func ClearMockAdminClients

func ClearMockAdminClients()

ClearMockAdminClients clears the cache of mock Admin clients

func ClearMockLockClients added in v0.28.0

func ClearMockLockClients()

ClearMockLockClients clears the cache of mock lock clients

func GetInstanceIDFromProcessID added in v0.24.0

func GetInstanceIDFromProcessID(id string) string

GetInstanceIDFromProcessID returns the instance ID for the process ID

func GetPodSpec

func GetPodSpec(cluster *fdbtypes.FoundationDBCluster, processClass fdbtypes.ProcessClass, idNum int) (*corev1.PodSpec, error)

GetPodSpec provides an external interface for the internal GetPodSpec method This is necessary for compatibility reasons.

func InitCustomMetrics added in v0.6.0

func InitCustomMetrics(reconciler *FoundationDBClusterReconciler)

InitCustomMetrics initializes the metrics collectors for the operator.

func MinimumFDBVersion added in v0.5.0

func MinimumFDBVersion() fdbtypes.FdbVersion

MinimumFDBVersion defines the minimum supported FDB version.

func NewFdbPodClient

func NewFdbPodClient(cluster *fdbtypes.FoundationDBCluster, pod *corev1.Pod) (internal.FdbPodClient, error)

NewFdbPodClient builds a client for working with an FDB Pod

func ParseInstanceID

func ParseInstanceID(id string) (fdbtypes.ProcessClass, int, error)

ParseInstanceID extracts the components of an instance ID.

Types

type AddPVCs added in v0.28.0

type AddPVCs struct{}

AddPVCs provides a reconciliation step for adding new PVCs to a cluster.

func (AddPVCs) Reconcile added in v0.28.0

Reconcile runs the reconciler's work.

type AddPods

type AddPods struct{}

AddPods provides a reconciliation step for adding new pods to a cluster.

func (AddPods) Reconcile

Reconcile runs the reconciler's work.

type AddProcessGroups added in v0.28.0

type AddProcessGroups struct{}

AddProcessGroups provides a reconciliation step for adding new pods to a cluster.

func (AddProcessGroups) Reconcile added in v0.28.0

Reconcile runs the reconciler's work.

type AddServices added in v0.14.0

type AddServices struct{}

AddServices provides a reconciliation step for adding services to a cluster.

func (AddServices) Reconcile added in v0.14.0

Reconcile runs the reconciler's work.

type AdminClient

type AdminClient interface {
	// GetStatus gets the database's status
	GetStatus() (*fdbtypes.FoundationDBStatus, error)

	// ConfigureDatabase sets the database configuration
	ConfigureDatabase(configuration fdbtypes.DatabaseConfiguration, newDatabase bool) error

	// ExcludeInstances starts evacuating processes so that they can be removed
	// from the database.
	ExcludeInstances(addresses []fdbtypes.ProcessAddress) error

	// IncludeInstances removes processes from the exclusion list and allows
	// them to take on roles again.
	IncludeInstances(addresses []fdbtypes.ProcessAddress) error

	// GetExclusions gets a list of the addresses currently excluded from the
	// database.
	GetExclusions() ([]fdbtypes.ProcessAddress, error)

	// CanSafelyRemove checks whether it is safe to remove processes from the
	// cluster.
	//
	// The list returned by this method will be the addresses that are *not*
	// safe to remove.
	CanSafelyRemove(addresses []fdbtypes.ProcessAddress) ([]fdbtypes.ProcessAddress, error)

	// KillProcesses restarts processes
	KillInstances(addresses []fdbtypes.ProcessAddress) error

	// ChangeCoordinators changes the coordinator set
	ChangeCoordinators(addresses []fdbtypes.ProcessAddress) (string, error)

	// GetConnectionString fetches the latest connection string.
	GetConnectionString() (string, error)

	// VersionSupported reports whether we can support a cluster with a given
	// version.
	VersionSupported(version string) (bool, error)

	// GetProtocolVersion determines the protocol version that is used by a
	// version of FDB.
	GetProtocolVersion(version string) (string, error)

	// StartBackup starts a new backup.
	StartBackup(url string, snapshotPeriodSeconds int) error

	// StopBackup stops a backup.
	StopBackup(url string) error

	// PauseBackups pauses the backups.
	PauseBackups() error

	// ResumeBackups resumes the backups.
	ResumeBackups() error

	// ModifyBackup modifies the configuration of the backup.
	ModifyBackup(int) error

	// GetBackupStatus gets the status of the current backup.
	GetBackupStatus() (*fdbtypes.FoundationDBLiveBackupStatus, error)

	// StartRestore starts a new restore.
	StartRestore(url string, keyRanges []fdbtypes.FoundationDBKeyRange) error

	// GetRestoreStatus gets the status of the current restore.
	GetRestoreStatus() (string, error)

	// Close shuts down any resources for the client once it is no longer
	// needed.
	Close() error

	// GetCoordinatorSet returns a set of the current coordinators.
	GetCoordinatorSet() (map[string]internal.None, error)
}

AdminClient describes an interface for running administrative commands on a cluster

func NewMockAdminClient

func NewMockAdminClient(cluster *fdbtypes.FoundationDBCluster, kubeClient client.Client) (AdminClient, error)

NewMockAdminClient creates an admin client for a cluster.

type BackupSubReconciler added in v0.7.0

type BackupSubReconciler interface {
	/**
	Reconcile runs the reconciler's work.

	If reconciliation can continue, this should return nil.

	If reconciliation encounters an error, this should return a Requeue object
	with an `Error` field.

	If reconciliation cannot proceed, this should return a Requeue object with a
	`Message` field.
	*/
	Reconcile(r *FoundationDBBackupReconciler, context ctx.Context, backup *fdbtypes.FoundationDBBackup) *Requeue
}

BackupSubReconciler describes a class that does part of the work of reconciliation for a backup.

type BounceProcesses

type BounceProcesses struct{}

BounceProcesses provides a reconciliation step for bouncing fdbserver processes.

func (BounceProcesses) Reconcile

Reconcile runs the reconciler's work.

type ChangeCoordinators

type ChangeCoordinators struct{}

ChangeCoordinators provides a reconciliation step for choosing new coordinators.

func (ChangeCoordinators) Reconcile

Reconcile runs the reconciler's work.

type CheckClientCompatibility

type CheckClientCompatibility struct{}

CheckClientCompatibility confirms that all clients are compatible with the version of FoundationDB configured on the cluster.

func (CheckClientCompatibility) Reconcile

Reconcile runs the reconciler's work.

type ChooseRemovals

type ChooseRemovals struct{}

ChooseRemovals chooses which processes will be removed during a shrink.

func (ChooseRemovals) Reconcile

Reconcile runs the reconciler's work.

type ClusterSubReconciler added in v0.7.0

type ClusterSubReconciler interface {
	/**
	Reconcile runs the reconciler's work.

	If reconciliation can continue, this should return nil.

	If reconciliation encounters an error, this should return a	Requeue object
	with an `Error` field.

	If reconciliation cannot proceed, this should return a Requeue object with
	a `Message` field.
	*/
	Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) *Requeue
}

ClusterSubReconciler describes a class that does part of the work of reconciliation for a cluster.

type DatabaseClientProvider added in v0.35.0

type DatabaseClientProvider interface {
	// GetLockClient generates a client for working with locks through the database.
	GetLockClient(cluster *fdbtypes.FoundationDBCluster) (LockClient, error)

	// GetAdminClient generates a client for performing administrative actions
	// against the database.
	GetAdminClient(cluster *fdbtypes.FoundationDBCluster, kubernetesClient client.Client) (AdminClient, error)
}

DatabaseClientProvider provides an abstraction for creating clients that communicate with the database.

type DeletePodsForBuggification added in v0.32.0

type DeletePodsForBuggification struct{}

DeletePodsForBuggification provides a reconciliation step for recreating pods with new pod specs when buggifying the config.

func (DeletePodsForBuggification) Reconcile added in v0.32.0

Reconcile runs the reconciler's work.

type ExcludeInstances

type ExcludeInstances struct{}

ExcludeInstances provides a reconciliation step for excluding instances from the database.

func (ExcludeInstances) Reconcile

Reconcile runs the reconciler's work.

type FdbInstance

type FdbInstance struct {
	Metadata *metav1.ObjectMeta
	Pod      *corev1.Pod
}

FdbInstance represents an instance of FDB that has been configured in Kubernetes.

func (FdbInstance) GetInstanceID added in v0.5.0

func (instance FdbInstance) GetInstanceID() string

GetInstanceID fetches the instance ID from an instance's metadata.

func (FdbInstance) GetProcessClass added in v0.5.0

func (instance FdbInstance) GetProcessClass() fdbtypes.ProcessClass

GetProcessClass fetches the process class from an instance's metadata.

func (FdbInstance) GetProcessID added in v0.24.0

func (instance FdbInstance) GetProcessID(processNumber int) string

GetProcessID fetches the instance ID from an instance's metadata.

func (FdbInstance) GetPublicIPSource added in v0.24.0

func (instance FdbInstance) GetPublicIPSource() fdbtypes.PublicIPSource

GetPublicIPSource determines how an instance has gotten its public IP.

func (FdbInstance) GetPublicIPs added in v0.27.0

func (instance FdbInstance) GetPublicIPs() []string

GetPublicIPs returns the public IP of an instance.

func (FdbInstance) NamespacedName

func (instance FdbInstance) NamespacedName() types.NamespacedName

NamespacedName gets the name of an instance along with its namespace

type FoundationDBBackupReconciler added in v0.7.0

type FoundationDBBackupReconciler struct {
	client.Client
	Recorder               record.EventRecorder
	Log                    logr.Logger
	InSimulation           bool
	DatabaseClientProvider DatabaseClientProvider
	// Deprecated: Use DatabaseClientProvider instead
	AdminClientProvider func(*fdbtypes.FoundationDBCluster, client.Client) (AdminClient, error)
}

FoundationDBBackupReconciler reconciles a FoundationDBCluster object

func (*FoundationDBBackupReconciler) AdminClientForBackup added in v0.8.0

func (r *FoundationDBBackupReconciler) AdminClientForBackup(context ctx.Context, backup *fdbtypes.FoundationDBBackup) (AdminClient, error)

AdminClientForBackup provides an admin client for a backup reconciler.

func (*FoundationDBBackupReconciler) Reconcile added in v0.7.0

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

Reconcile runs the reconciliation logic.

func (*FoundationDBBackupReconciler) SetupWithManager added in v0.7.0

func (r *FoundationDBBackupReconciler) SetupWithManager(mgr ctrl.Manager, maxConcurrentReconciles int) error

SetupWithManager prepares a reconciler for use.

type FoundationDBClusterReconciler

type FoundationDBClusterReconciler struct {
	client.Client
	Recorder            record.EventRecorder
	Log                 logr.Logger
	InSimulation        bool
	PodLifecycleManager PodLifecycleManager
	PodClientProvider   func(*fdbtypes.FoundationDBCluster, *corev1.Pod) (internal.FdbPodClient, error)

	DatabaseClientProvider DatabaseClientProvider
	DeprecationOptions     internal.DeprecationOptions
	RequeueOnNotFound      bool

	// Deprecated: Use DatabaseClientProvider instead
	AdminClientProvider func(*fdbtypes.FoundationDBCluster, client.Client) (AdminClient, error)

	// Deprecated: Use DatabaseClientProvider instead
	LockClientProvider LockClientProvider
}

FoundationDBClusterReconciler reconciles a FoundationDBCluster object

func NewFoundationDBClusterReconciler added in v0.39.2

func NewFoundationDBClusterReconciler(podLifecycleManager PodLifecycleManager) *FoundationDBClusterReconciler

NewFoundationDBClusterReconciler creates a new FoundationDBClusterReconciler with defaults.

func (*FoundationDBClusterReconciler) Reconcile

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

Reconcile runs the reconciliation logic.

func (*FoundationDBClusterReconciler) SetupWithManager

func (r *FoundationDBClusterReconciler) SetupWithManager(mgr ctrl.Manager, maxConcurrentReconciles int, watchedObjects ...client.Object) error

SetupWithManager prepares a reconciler for use.

type FoundationDBRestoreReconciler added in v0.11.0

type FoundationDBRestoreReconciler struct {
	client.Client
	Recorder     record.EventRecorder
	Log          logr.Logger
	InSimulation bool

	DatabaseClientProvider DatabaseClientProvider
	// Deprecated: Use DatabaseClientProvider instead
	AdminClientProvider func(*fdbtypes.FoundationDBCluster, client.Client) (AdminClient, error)
}

FoundationDBRestoreReconciler reconciles a FoundationDBRestore object

func (*FoundationDBRestoreReconciler) AdminClientForRestore added in v0.11.0

func (r *FoundationDBRestoreReconciler) AdminClientForRestore(context ctx.Context, restore *fdbtypes.FoundationDBRestore) (AdminClient, error)

AdminClientForRestore provides an admin client for a restore reconciler.

func (*FoundationDBRestoreReconciler) Reconcile added in v0.11.0

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

Reconcile runs the reconciliation logic.

func (*FoundationDBRestoreReconciler) SetupWithManager added in v0.11.0

func (r *FoundationDBRestoreReconciler) SetupWithManager(mgr ctrl.Manager, maxConcurrentReconciles int) error

SetupWithManager prepares a reconciler for use.

type GenerateInitialClusterFile

type GenerateInitialClusterFile struct{}

GenerateInitialClusterFile provides a reconciliation step for generating the cluster file for a newly created cluster.

func (GenerateInitialClusterFile) Reconcile

Reconcile runs the reconciler's work.

type LockClient added in v0.13.0

type LockClient interface {
	// Disabled determines whether the locking is disabled.
	Disabled() bool

	// TakeLock attempts to acquire a lock.
	TakeLock() (bool, error)

	// AddPendingUpgrades registers information about which process groups are
	// pending an upgrade to a new version.
	AddPendingUpgrades(version fdbtypes.FdbVersion, processGroupIDs []string) error

	// GetPendingUpgrades returns the stored information about which process
	// groups are pending an upgrade to a new version.
	GetPendingUpgrades(version fdbtypes.FdbVersion) (map[string]bool, error)

	// ClearPendingUpgrades clears any stored information about pending
	// upgrades.
	ClearPendingUpgrades() error

	// GetDenyList retrieves the current deny list from the database.
	GetDenyList() ([]string, error)

	// UpdateDenyList updates the deny list to match a list of entries.
	UpdateDenyList(locks []fdbtypes.LockDenyListEntry) error
}

LockClient provides a client for getting locks on operations for a cluster.

func NewMockLockClient added in v0.13.0

func NewMockLockClient(cluster *fdbtypes.FoundationDBCluster) (LockClient, error)

NewMockLockClient creates a mock lock client.

type LockClientProvider added in v0.13.0

type LockClientProvider func(*fdbtypes.FoundationDBCluster) (LockClient, error)

LockClientProvider provides a dependency injection for creating a lock client. Deprecated: Use DatabaseClientProvider instead.

type MockAdminClient

type MockAdminClient struct {
	Cluster               *fdbtypes.FoundationDBCluster
	KubeClient            client.Client
	DatabaseConfiguration *fdbtypes.DatabaseConfiguration
	ExcludedAddresses     []string
	ReincludedAddresses   map[string]bool
	KilledAddresses       []string

	Backups map[string]fdbtypes.FoundationDBBackupStatusBackupDetails
	// contains filtered or unexported fields
}

MockAdminClient provides a mock implementation of the cluster admin interface

func (*MockAdminClient) CanSafelyRemove

func (client *MockAdminClient) CanSafelyRemove(addresses []fdbtypes.ProcessAddress) ([]fdbtypes.ProcessAddress, error)

CanSafelyRemove checks whether it is safe to remove instances from the cluster

The list returned by this method will be the addresses that are *not* safe to remove.

func (*MockAdminClient) ChangeCoordinators

func (client *MockAdminClient) ChangeCoordinators(addresses []fdbtypes.ProcessAddress) (string, error)

ChangeCoordinators changes the coordinator set

func (*MockAdminClient) Close

func (client *MockAdminClient) Close() error

Close shuts down any resources for the client once it is no longer needed.

func (*MockAdminClient) ConfigureDatabase

func (client *MockAdminClient) ConfigureDatabase(configuration fdbtypes.DatabaseConfiguration, newDatabase bool) error

ConfigureDatabase changes the database configuration

func (*MockAdminClient) ExcludeInstances

func (client *MockAdminClient) ExcludeInstances(addresses []fdbtypes.ProcessAddress) error

ExcludeInstances starts evacuating processes so that they can be removed from the database.

func (*MockAdminClient) FreezeStatus

func (client *MockAdminClient) FreezeStatus() error

FreezeStatus causes the GetStatus method to return its current value until UnfreezeStatus is called, or another method is called which would invalidate the status.

func (*MockAdminClient) GetBackupStatus added in v0.10.0

func (client *MockAdminClient) GetBackupStatus() (*fdbtypes.FoundationDBLiveBackupStatus, error)

GetBackupStatus gets the status of the current backup.

func (*MockAdminClient) GetConnectionString added in v0.5.0

func (client *MockAdminClient) GetConnectionString() (string, error)

GetConnectionString fetches the latest connection string.

func (*MockAdminClient) GetCoordinatorSet added in v0.37.0

func (client *MockAdminClient) GetCoordinatorSet() (map[string]internal.None, error)

GetCoordinatorSet gets the current coordinators from the status

func (*MockAdminClient) GetExclusions added in v0.23.0

func (client *MockAdminClient) GetExclusions() ([]fdbtypes.ProcessAddress, error)

GetExclusions gets a list of the addresses currently excluded from the database.

func (*MockAdminClient) GetProtocolVersion

func (client *MockAdminClient) GetProtocolVersion(version string) (string, error)

GetProtocolVersion determines the protocol version that is used by a version of FDB.

func (*MockAdminClient) GetRestoreStatus added in v0.11.0

func (client *MockAdminClient) GetRestoreStatus() (string, error)

GetRestoreStatus gets the status of the current restore.

func (*MockAdminClient) GetStatus

func (client *MockAdminClient) GetStatus() (*fdbtypes.FoundationDBStatus, error)

GetStatus gets the database's status

func (*MockAdminClient) IncludeInstances

func (client *MockAdminClient) IncludeInstances(addresses []fdbtypes.ProcessAddress) error

IncludeInstances removes instances from the exclusion list and allows them to take on roles again.

func (*MockAdminClient) KillInstances

func (client *MockAdminClient) KillInstances(addresses []fdbtypes.ProcessAddress) error

KillInstances restarts processes

func (*MockAdminClient) MockAdditionalProcesses added in v0.28.0

func (client *MockAdminClient) MockAdditionalProcesses(processes []fdbtypes.ProcessGroupStatus)

MockAdditionalProcesses adds additional processes to the cluster status.

func (*MockAdminClient) MockClientVersion added in v0.16.0

func (client *MockAdminClient) MockClientVersion(version string, clients []string)

MockClientVersion returns a mocked client version

func (*MockAdminClient) MockIncorrectCommandLine added in v0.30.0

func (client *MockAdminClient) MockIncorrectCommandLine(instanceID string, incorrect bool)

MockIncorrectCommandLine updates the mock for whether a process group should be have an incorrect command-line.

func (*MockAdminClient) MockLocalityInfo added in v0.30.0

func (client *MockAdminClient) MockLocalityInfo(processGroupID string, locality map[string]string)

MockLocalityInfo sets mock locality information for a process.

func (*MockAdminClient) MockMissingProcessGroup added in v0.28.0

func (client *MockAdminClient) MockMissingProcessGroup(instanceID string, missing bool)

MockMissingProcessGroup updates the mock for whether a process group should be missing from the cluster status.

func (*MockAdminClient) ModifyBackup added in v0.10.0

func (client *MockAdminClient) ModifyBackup(snapshotPeriodSeconds int) error

ModifyBackup reconfigures the backup.

func (*MockAdminClient) PauseBackups added in v0.9.0

func (client *MockAdminClient) PauseBackups() error

PauseBackups pauses backups.

func (*MockAdminClient) ResumeBackups added in v0.9.0

func (client *MockAdminClient) ResumeBackups() error

ResumeBackups resumes backups.

func (*MockAdminClient) StartBackup added in v0.8.0

func (client *MockAdminClient) StartBackup(url string, snapshotPeriodSeconds int) error

StartBackup starts a new backup.

func (*MockAdminClient) StartRestore added in v0.11.0

func (client *MockAdminClient) StartRestore(url string, keyRanges []fdbtypes.FoundationDBKeyRange) error

StartRestore starts a new restore.

func (*MockAdminClient) StopBackup added in v0.9.0

func (client *MockAdminClient) StopBackup(url string) error

StopBackup stops a backup.

func (*MockAdminClient) UnfreezeStatus

func (client *MockAdminClient) UnfreezeStatus()

UnfreezeStatus causes the admin client to start recalculating the status on every call to GetStatus

func (*MockAdminClient) VersionSupported

func (client *MockAdminClient) VersionSupported(versionString string) (bool, error)

VersionSupported reports whether we can support a cluster with a given version.

type MockLockClient added in v0.13.0

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

MockLockClient provides a mock client for managing operation locks.

func (*MockLockClient) AddPendingUpgrades added in v0.28.0

func (client *MockLockClient) AddPendingUpgrades(version fdbtypes.FdbVersion, processGroupIDs []string) error

AddPendingUpgrades registers information about which process groups are pending an upgrade to a new version.

func (*MockLockClient) ClearPendingUpgrades added in v0.28.0

func (client *MockLockClient) ClearPendingUpgrades() error

ClearPendingUpgrades clears any stored information about pending upgrades.

func (*MockLockClient) Disabled added in v0.24.0

func (client *MockLockClient) Disabled() bool

Disabled determines if the client should automatically grant locks.

func (*MockLockClient) GetDenyList added in v0.29.0

func (client *MockLockClient) GetDenyList() ([]string, error)

GetDenyList retrieves the current deny list from the database.

func (*MockLockClient) GetPendingUpgrades added in v0.28.0

func (client *MockLockClient) GetPendingUpgrades(version fdbtypes.FdbVersion) (map[string]bool, error)

GetPendingUpgrades returns the stored information about which process groups are pending an upgrade to a new version.

func (*MockLockClient) TakeLock added in v0.13.0

func (client *MockLockClient) TakeLock() (bool, error)

TakeLock attempts to acquire a lock.

func (*MockLockClient) UpdateDenyList added in v0.29.0

func (client *MockLockClient) UpdateDenyList(locks []fdbtypes.LockDenyListEntry) error

UpdateDenyList updates the deny list to match a list of entries. This will return the complete deny list after these changes are made.

type ModifyBackup added in v0.10.0

type ModifyBackup struct {
}

ModifyBackup provides a reconciliation step for modifying a backup's configuration.

func (ModifyBackup) Reconcile added in v0.10.0

Reconcile runs the reconciler's work.

type PodLifecycleManager

type PodLifecycleManager interface {
	// GetInstances lists the instances in the cluster
	GetInstances(client.Client, *fdbtypes.FoundationDBCluster, ctx.Context, ...client.ListOption) ([]FdbInstance, error)

	// CreateInstance creates a new instance based on a pod definition
	CreateInstance(client.Client, ctx.Context, *corev1.Pod) error

	// DeleteInstance shuts down an instance
	DeleteInstance(client.Client, ctx.Context, FdbInstance) error

	// CanDeletePods checks whether it is safe to delete pods.
	CanDeletePods(AdminClient, ctx.Context, *fdbtypes.FoundationDBCluster) (bool, error)

	// UpdatePods updates a list of pods to match the latest specs.
	UpdatePods(client.Client, ctx.Context, *fdbtypes.FoundationDBCluster, []FdbInstance, bool) error

	// UpdateImageVersion updates a container's image.
	UpdateImageVersion(client.Client, ctx.Context, *fdbtypes.FoundationDBCluster, FdbInstance, int, string) error

	// UpdateMetadata updates an instance's metadata.
	UpdateMetadata(client.Client, ctx.Context, *fdbtypes.FoundationDBCluster, FdbInstance) error

	// InstanceIsUpdated determines whether an instance is up to date.
	//
	// This does not need to check the metadata or the pod spec hash. This only
	// needs to check aspects of the rollout that are not available in the
	// instance metadata.
	InstanceIsUpdated(client.Client, ctx.Context, *fdbtypes.FoundationDBCluster, FdbInstance) (bool, error)
}

PodLifecycleManager provides an abstraction around Pod management to allow using intermediary controllers that will manage the Pod lifecycle.

type RemoveProcessGroups added in v0.39.0

type RemoveProcessGroups struct{}

RemoveProcessGroups provides a reconciliation step for removing process groups as part of a shrink or replacement.

func (RemoveProcessGroups) Reconcile added in v0.39.0

Reconcile runs the reconciler's work.

type RemoveServices added in v0.14.0

type RemoveServices struct{}

RemoveServices provides a reconciliation step for removing services from a cluster.

func (RemoveServices) Reconcile added in v0.14.0

Reconcile runs the reconciler's work.

type ReplaceFailedPods added in v0.28.0

type ReplaceFailedPods struct{}

ReplaceFailedPods identifies processes that have failed and need to be replaced.

func (ReplaceFailedPods) Reconcile added in v0.28.0

Reconcile runs the reconciler's work.

type ReplaceMisconfiguredPods added in v0.9.0

type ReplaceMisconfiguredPods struct{}

ReplaceMisconfiguredPods identifies processes that need to be replaced in order to bring up new processes with different configuration.

func (ReplaceMisconfiguredPods) Reconcile added in v0.9.0

Reconcile runs the reconciler's work.

type Requeue added in v0.38.0

type Requeue struct {
	// Delay provides an optional delay before requeueing reconciliation.
	Delay time.Duration

	// Error provides an error that we encountered that forced a requeue.
	Error error

	// Message provides a log message that explains the reason for the requeue.
	Message string

	// DelayedRequeue defines that the reconciliation was not completed but the requeue should be delayed to the end.
	DelayedRequeue bool
}

Requeue provides a wrapper around different results from a subreconciler.

type RestoreSubReconciler added in v0.11.0

type RestoreSubReconciler interface {
	/**
	Reconcile runs the reconciler's work.

	If reconciliation can continue, this should return nil.

	If reconciliation encounters an error, this should return a `Requeue` object
	with an `Error` field.

	If reconciliation cannot proceed, this should return a `Requeue` object with
	a `Message` field.
	*/
	Reconcile(r *FoundationDBRestoreReconciler, context ctx.Context, restore *fdbtypes.FoundationDBRestore) *Requeue
}

RestoreSubReconciler describes a class that does part of the work of reconciliation for a restore.

type StandardPodLifecycleManager

type StandardPodLifecycleManager struct{}

StandardPodLifecycleManager provides an implementation of PodLifecycleManager that directly creates pods.

func (StandardPodLifecycleManager) CanDeletePods

func (manager StandardPodLifecycleManager) CanDeletePods(adminClient AdminClient, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error)

CanDeletePods checks whether it is safe to delete pods.

func (StandardPodLifecycleManager) CreateInstance

func (manager StandardPodLifecycleManager) CreateInstance(r client.Client, context ctx.Context, pod *corev1.Pod) error

CreateInstance creates a new instance based on a pod definition

func (StandardPodLifecycleManager) DeleteInstance

func (manager StandardPodLifecycleManager) DeleteInstance(r client.Client, context ctx.Context, instance FdbInstance) error

DeleteInstance shuts down an instance

func (StandardPodLifecycleManager) GetInstances

func (manager StandardPodLifecycleManager) GetInstances(r client.Client, cluster *fdbtypes.FoundationDBCluster, context ctx.Context, options ...client.ListOption) ([]FdbInstance, error)

GetInstances returns a list of instances for FDB pods that have been created.

func (StandardPodLifecycleManager) InstanceIsUpdated added in v0.6.0

InstanceIsUpdated determines whether an instance is up to date.

This does not need to check the metadata or the pod spec hash. This only needs to check aspects of the rollout that are not available in the instance metadata.

func (StandardPodLifecycleManager) UpdateImageVersion added in v0.10.0

func (manager StandardPodLifecycleManager) UpdateImageVersion(r client.Client, context ctx.Context, cluster *fdbtypes.FoundationDBCluster, instance FdbInstance, containerIndex int, image string) error

UpdateImageVersion updates a container's image.

func (StandardPodLifecycleManager) UpdateMetadata added in v0.6.0

func (manager StandardPodLifecycleManager) UpdateMetadata(r client.Client, context ctx.Context, cluster *fdbtypes.FoundationDBCluster, instance FdbInstance) error

UpdateMetadata updates an instance's metadata.

func (StandardPodLifecycleManager) UpdatePods

func (manager StandardPodLifecycleManager) UpdatePods(r client.Client, context ctx.Context, cluster *fdbtypes.FoundationDBCluster, instances []FdbInstance, unsafe bool) error

UpdatePods updates a list of pods to match the latest specs.

type StartBackup added in v0.8.0

type StartBackup struct {
}

StartBackup provides a reconciliation step for starting a new backup.

func (StartBackup) Reconcile added in v0.8.0

Reconcile runs the reconciler's work.

type StartRestore added in v0.11.0

type StartRestore struct {
}

StartRestore provides a reconciliation step for starting a new restore.

func (StartRestore) Reconcile added in v0.11.0

Reconcile runs the reconciler's work.

type StopBackup added in v0.9.0

type StopBackup struct {
}

StopBackup provides a reconciliation step for stopping backup.

func (StopBackup) Reconcile added in v0.9.0

Reconcile runs the reconciler's work.

type ToggleBackupPaused added in v0.9.0

type ToggleBackupPaused struct {
}

ToggleBackupPaused provides a reconciliation step for pausing an unpausing backups.

func (ToggleBackupPaused) Reconcile added in v0.9.0

Reconcile runs the reconciler's work.

type UpdateBackupAgents added in v0.7.0

type UpdateBackupAgents struct{}

UpdateBackupAgents provides a reconciliation step for updating the deployment for the backup agents.

func (UpdateBackupAgents) Reconcile added in v0.7.0

Reconcile runs the reconciler's work.

type UpdateBackupStatus added in v0.7.0

type UpdateBackupStatus struct {
}

UpdateBackupStatus provides a reconciliation step for updating the status in the CRD.

func (UpdateBackupStatus) Reconcile added in v0.7.0

Reconcile runs the reconciler's work.

type UpdateConfigMap

type UpdateConfigMap struct{}

UpdateConfigMap provides a reconciliation step for updating the dynamic config for a cluster.

func (UpdateConfigMap) Reconcile

Reconcile runs the reconciler's work.

type UpdateDatabaseConfiguration

type UpdateDatabaseConfiguration struct{}

UpdateDatabaseConfiguration provides a reconciliation step for changing the database configuration.

func (UpdateDatabaseConfiguration) Reconcile

Reconcile runs the reconciler's work.

type UpdateLabels

type UpdateLabels struct{}

UpdateLabels provides a reconciliation step for updating the labels on pods.

func (UpdateLabels) Reconcile

Reconcile runs the reconciler's work.

type UpdateLockConfiguration added in v0.29.0

type UpdateLockConfiguration struct{}

UpdateLockConfiguration reconciles the state of the locking system in the database with the cluster configuration.

func (UpdateLockConfiguration) Reconcile added in v0.29.0

Reconcile runs the reconciler's work.

type UpdatePodConfig added in v0.33.0

type UpdatePodConfig struct{}

UpdatePodConfig provides a reconciliation step for updating the dynamic conf for a all pods.

func (UpdatePodConfig) Reconcile added in v0.33.0

Reconcile runs the reconciler's work.

type UpdatePods

type UpdatePods struct{}

UpdatePods provides a reconciliation step for recreating pods with new pod specs.

func (UpdatePods) Reconcile

Reconcile runs the reconciler's work.

type UpdateSidecarVersions

type UpdateSidecarVersions struct {
}

UpdateSidecarVersions provides a reconciliation step for upgrading the sidecar.

func (UpdateSidecarVersions) Reconcile

Reconcile runs the reconciler's work.

type UpdateStatus

type UpdateStatus struct {
}

UpdateStatus provides a reconciliation step for updating the status in the CRD.

func (UpdateStatus) Reconcile

Reconcile runs the reconciler's work.

Jump to

Keyboard shortcuts

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