Documentation ¶
Index ¶
- Constants
- Variables
- func CheckAndSetProcessStatus(r *FoundationDBClusterReconciler, cluster *fdbtypes.FoundationDBCluster, ...) error
- func CheckDynamicFilePresent(client FdbPodClient, filename string) (bool, error)
- func ClearMockAdminClients()
- func GetBackupDeployment(backup *fdbtypes.FoundationDBBackup) (*appsv1.Deployment, error)
- func GetConfigMap(cluster *fdbtypes.FoundationDBCluster) (*corev1.ConfigMap, error)
- func GetConfigMapHash(cluster *fdbtypes.FoundationDBCluster) (string, error)
- func GetDynamicConfHash(configMap *corev1.ConfigMap) (string, error)
- func GetHeadlessService(cluster *fdbtypes.FoundationDBCluster) *corev1.Service
- func GetInstanceIDFromMeta(metadata metav1.ObjectMeta) string
- func GetInstanceIDFromProcessID(id string) string
- func GetJSONHash(object interface{}) (string, error)
- func GetMonitorConf(cluster *fdbtypes.FoundationDBCluster, processClass string, ...) (string, error)
- func GetPod(cluster *fdbtypes.FoundationDBCluster, processClass string, idNum int) (*corev1.Pod, error)
- func GetPodSpec(cluster *fdbtypes.FoundationDBCluster, processClass string, idNum int) (*corev1.PodSpec, error)
- func GetPodSpecHash(cluster *fdbtypes.FoundationDBCluster, processClass string, id int, ...) (string, error)
- func GetProcessClassFromMeta(metadata metav1.ObjectMeta) string
- func GetPvc(cluster *fdbtypes.FoundationDBCluster, processClass string, idNum int) (*corev1.PersistentVolumeClaim, error)
- func GetService(cluster *fdbtypes.FoundationDBCluster, processClass string, idNum int) (*corev1.Service, error)
- func GetStartCommand(cluster *fdbtypes.FoundationDBCluster, instance FdbInstance, ...) (string, error)
- func InitCustomMetrics(reconciler *FoundationDBClusterReconciler)
- func MinimumFDBVersion() fdbtypes.FdbVersion
- func MissingPodError(instance FdbInstance, cluster *fdbtypes.FoundationDBCluster) error
- func MissingPodErrorByName(instanceName string, cluster *fdbtypes.FoundationDBCluster) error
- func MockPodIP(pod *corev1.Pod) string
- func NormalizeClusterSpec(spec *fdbtypes.FoundationDBClusterSpec, options DeprecationOptions) error
- func ParseInstanceID(id string) (string, int, error)
- func RemoveAddressFlags(address string) string
- func RemoveAddressFlagsFromAll(addresses []string) []string
- func UpdateDynamicFiles(client FdbPodClient, filename string, contents string, ...) (bool, error)
- func ValidateCustomParameters(customParameters []string) error
- type AddPods
- type AddServices
- type AdminClient
- type BackupSubReconciler
- type BounceProcesses
- type ChangeCoordinators
- type CheckClientCompatibility
- type ChooseRemovals
- type CliAdminClient
- func (client *CliAdminClient) CanSafelyRemove(addresses []string) ([]string, error)
- func (client *CliAdminClient) ChangeCoordinators(addresses []string) (string, error)
- func (client *CliAdminClient) Close() error
- func (client *CliAdminClient) ConfigureDatabase(configuration fdbtypes.DatabaseConfiguration, newDatabase bool) error
- func (client *CliAdminClient) ExcludeInstances(addresses []string) error
- func (client *CliAdminClient) GetBackupStatus() (*fdbtypes.FoundationDBLiveBackupStatus, error)
- func (client *CliAdminClient) GetConnectionString() (string, error)
- func (client *CliAdminClient) GetExclusions() ([]string, error)
- func (client *CliAdminClient) GetMinimalStatus() (string, error)
- func (client *CliAdminClient) GetProtocolVersion(version string) (string, error)
- func (client *CliAdminClient) GetRestoreStatus() (string, error)
- func (client *CliAdminClient) GetStatus() (*fdbtypes.FoundationDBStatus, error)
- func (client *CliAdminClient) IncludeInstances(addresses []string) error
- func (client *CliAdminClient) KillInstances(addresses []string) error
- func (client *CliAdminClient) ModifyBackup(snapshotPeriodSeconds int) error
- func (client *CliAdminClient) PauseBackups() error
- func (client *CliAdminClient) ResumeBackups() error
- func (client *CliAdminClient) StartBackup(url string, snapshotPeriodSeconds int) error
- func (client *CliAdminClient) StartRestore(url string) error
- func (client *CliAdminClient) StopBackup(url string) error
- func (client *CliAdminClient) VersionSupported(versionString string) (bool, error)
- type ClusterSubReconciler
- type ConfirmExclusionCompletion
- type DeprecationOptions
- type ExcludeInstances
- type FdbInstance
- func (instance FdbInstance) GetInstanceID() string
- func (instance FdbInstance) GetProcessClass() string
- func (instance FdbInstance) GetProcessID(processNumber int) string
- func (instance FdbInstance) GetPublicIPSource() fdbtypes.PublicIPSource
- func (instance FdbInstance) GetPublicIPs() []string
- func (instance FdbInstance) NamespacedName() types.NamespacedName
- type FdbPodClient
- type FoundationDBBackupReconciler
- func (r *FoundationDBBackupReconciler) AdminClientForBackup(context ctx.Context, backup *fdbtypes.FoundationDBBackup) (AdminClient, error)
- func (r *FoundationDBBackupReconciler) Reconcile(request ctrl.Request) (ctrl.Result, error)
- func (r *FoundationDBBackupReconciler) SetupWithManager(mgr ctrl.Manager) error
- type FoundationDBClusterReconciler
- func (r *FoundationDBClusterReconciler) CheckDeprecations(context ctx.Context) error
- func (r *FoundationDBClusterReconciler) GetDeprecations(context ctx.Context) ([]fdbtypes.FoundationDBCluster, error)
- func (r *FoundationDBClusterReconciler) Reconcile(request ctrl.Request) (ctrl.Result, error)
- func (r *FoundationDBClusterReconciler) SetupWithManager(mgr ctrl.Manager) error
- type FoundationDBRestoreReconciler
- func (r *FoundationDBRestoreReconciler) AdminClientForRestore(context ctx.Context, restore *fdbtypes.FoundationDBRestore) (AdminClient, error)
- func (r *FoundationDBRestoreReconciler) Reconcile(request ctrl.Request) (ctrl.Result, error)
- func (r *FoundationDBRestoreReconciler) SetupWithManager(mgr ctrl.Manager) error
- type GenerateInitialClusterFile
- type InvalidLockValue
- type LockClient
- type LockClientProvider
- type MockAdminClient
- func (client *MockAdminClient) CanSafelyRemove(addresses []string) ([]string, error)
- func (client *MockAdminClient) ChangeCoordinators(addresses []string) (string, error)
- func (client *MockAdminClient) Close() error
- func (client *MockAdminClient) ConfigureDatabase(configuration fdbtypes.DatabaseConfiguration, newDatabase bool) error
- func (client *MockAdminClient) ExcludeInstances(addresses []string) error
- func (client *MockAdminClient) FreezeStatus() error
- func (client *MockAdminClient) GetBackupStatus() (*fdbtypes.FoundationDBLiveBackupStatus, error)
- func (client *MockAdminClient) GetConnectionString() (string, error)
- func (client *MockAdminClient) GetExclusions() ([]string, error)
- func (client *MockAdminClient) GetMinimalStatus() (string, error)
- func (client *MockAdminClient) GetProtocolVersion(version string) (string, error)
- func (client *MockAdminClient) GetRestoreStatus() (string, error)
- func (client *MockAdminClient) GetStatus() (*fdbtypes.FoundationDBStatus, error)
- func (client *MockAdminClient) IncludeInstances(addresses []string) error
- func (client *MockAdminClient) KillInstances(addresses []string) error
- func (client *MockAdminClient) MockClientVersion(version string, clients []string)
- func (client *MockAdminClient) ModifyBackup(snapshotPeriodSeconds int) error
- func (client *MockAdminClient) PauseBackups() error
- func (client *MockAdminClient) ResumeBackups() error
- func (client *MockAdminClient) StartBackup(url string, snapshotPeriodSeconds int) error
- func (client *MockAdminClient) StartRestore(url string) error
- func (client *MockAdminClient) StopBackup(url string) error
- func (client *MockAdminClient) UnfreezeStatus()
- func (client *MockAdminClient) VersionSupported(versionString string) (bool, error)
- type MockLockClient
- type ModifyBackup
- type PodLifecycleManager
- type RealLockClient
- type ReconciliationNotReadyError
- type RemovePods
- type RemoveServices
- type ReplaceMisconfiguredPods
- type RestoreSubReconciler
- type StandardPodLifecycleManager
- func (manager StandardPodLifecycleManager) CanDeletePods(r *FoundationDBClusterReconciler, context ctx.Context, ...) (bool, error)
- func (manager StandardPodLifecycleManager) CreateInstance(r *FoundationDBClusterReconciler, context ctx.Context, pod *corev1.Pod) error
- func (manager StandardPodLifecycleManager) DeleteInstance(r *FoundationDBClusterReconciler, context ctx.Context, instance FdbInstance) error
- func (manager StandardPodLifecycleManager) GetInstances(r *FoundationDBClusterReconciler, cluster *fdbtypes.FoundationDBCluster, ...) ([]FdbInstance, error)
- func (manager StandardPodLifecycleManager) InstanceIsUpdated(*FoundationDBClusterReconciler, ctx.Context, *fdbtypes.FoundationDBCluster, ...) (bool, error)
- func (manager StandardPodLifecycleManager) UpdateImageVersion(r *FoundationDBClusterReconciler, context ctx.Context, ...) error
- func (manager StandardPodLifecycleManager) UpdateMetadata(r *FoundationDBClusterReconciler, context ctx.Context, ...) error
- func (manager StandardPodLifecycleManager) UpdatePods(r *FoundationDBClusterReconciler, context ctx.Context, ...) error
- type StartBackup
- type StartRestore
- type StopBackup
- type ToggleBackupPaused
- type UpdateBackupAgents
- type UpdateBackupStatus
- type UpdateConfigMap
- type UpdateDatabaseConfiguration
- type UpdateLabels
- type UpdatePods
- type UpdateSidecarVersions
- type UpdateStatus
Constants ¶
const ( // LastSpecKey provides the annotation name we use to store the hash of the // pod spec. LastSpecKey = "foundationdb.org/last-applied-spec" // LastConfigMapKey provides the annotation name we use to store the hash of the // config map. LastConfigMapKey = "foundationdb.org/last-applied-config-map" // BackupDeploymentLabel provides the label we use to connect backup // deployments to a cluster. BackupDeploymentLabel = "foundationdb.org/backup-for" // MinimumUptimeSecondsForBounce defines the minimum time, in seconds, that the // processes in the cluster must have been up for before the operator can // execute a bounce. MinimumUptimeSecondsForBounce = 600 // PublicIPSourceAnnotation is an annotation key that specifies where a pod // gets its public IP from. PublicIPSourceAnnotation = "foundationdb.org/public-ip-source" // PublicIPAnnotation is an annotation key that specifies the current public // IP for a pod. PublicIPAnnotation = "foundationdb.org/public-ip" // FDBInstanceIDLabel represents the label that is used to represent a instance ID FDBInstanceIDLabel = "fdb-instance-id" // FDBProcessClassLabel represents the label that is used to represent the process class FDBProcessClassLabel = "fdb-process-class" // FDBClusterLabel represents the label that is used to represent the cluster of an instance FDBClusterLabel = "fdb-cluster-name" // NodeSelectorNoScheduleLabel is a label used when adding node selectors to block scheduling. NodeSelectorNoScheduleLabel = "foundationdb.org/no-schedule-allowed" )
Variables ¶
var DefaultCLITimeout = 10
DefaultCLITimeout is the default timeout for CLI commands.
Functions ¶
func CheckAndSetProcessStatus ¶ added in v0.24.0
func CheckAndSetProcessStatus(r *FoundationDBClusterReconciler, cluster *fdbtypes.FoundationDBCluster, instance FdbInstance, processMap map[string][]fdbtypes.FoundationDBStatusProcessInfo, status *fdbtypes.FoundationDBClusterStatus, 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 CheckDynamicFilePresent ¶
func CheckDynamicFilePresent(client FdbPodClient, filename string) (bool, error)
CheckDynamicFilePresent waits for a file to be present in the dynamic conf
func ClearMockAdminClients ¶
func ClearMockAdminClients()
ClearMockAdminClients clears the cache of mock Admin clients
func GetBackupDeployment ¶ added in v0.7.0
func GetBackupDeployment(backup *fdbtypes.FoundationDBBackup) (*appsv1.Deployment, error)
GetBackupDeployment builds a deployment for backup agents for a cluster.
func GetConfigMap ¶
func GetConfigMap(cluster *fdbtypes.FoundationDBCluster) (*corev1.ConfigMap, error)
GetConfigMap builds a config map for a cluster's dynamic config
func GetConfigMapHash ¶ added in v0.16.0
func GetConfigMapHash(cluster *fdbtypes.FoundationDBCluster) (string, error)
GetConfigMapHash gets the hash of the data for a cluster's dynamic config.
func GetDynamicConfHash ¶ added in v0.16.0
GetDynamicConfHash gets a hash of the data from the config map holding the cluster's dynamic conf.
This will omit keys that we do not expect the pods to reference.
func GetHeadlessService ¶ added in v0.14.0
func GetHeadlessService(cluster *fdbtypes.FoundationDBCluster) *corev1.Service
GetHeadlessService builds a headless service for a FoundationDB cluster.
func GetInstanceIDFromMeta ¶ added in v0.5.0
func GetInstanceIDFromMeta(metadata metav1.ObjectMeta) string
GetInstanceIDFromMeta fetches the instance ID from an object's metadata.
func GetInstanceIDFromProcessID ¶ added in v0.24.0
GetInstanceIDFromProcessID returns the instance ID for the process ID
func GetJSONHash ¶ added in v0.7.0
GetJSONHash serializes an object to JSON and takes a hash of the resulting JSON.
func GetMonitorConf ¶
func GetMonitorConf(cluster *fdbtypes.FoundationDBCluster, processClass string, podClient FdbPodClient, serversPerPod int) (string, error)
GetMonitorConf builds the monitor conf template
func GetPod ¶
func GetPod(cluster *fdbtypes.FoundationDBCluster, processClass string, idNum int) (*corev1.Pod, error)
GetPod builds a pod for a new instance
func GetPodSpec ¶
func GetPodSpec(cluster *fdbtypes.FoundationDBCluster, processClass string, idNum int) (*corev1.PodSpec, error)
GetPodSpec builds a pod spec for a FoundationDB pod
func GetPodSpecHash ¶
func GetPodSpecHash(cluster *fdbtypes.FoundationDBCluster, processClass string, id int, spec *corev1.PodSpec) (string, error)
GetPodSpecHash builds the hash of the expected spec for a pod.
func GetProcessClassFromMeta ¶ added in v0.5.0
func GetProcessClassFromMeta(metadata metav1.ObjectMeta) string
GetProcessClassFromMeta fetches the process class from an object's metadata.
func GetPvc ¶
func GetPvc(cluster *fdbtypes.FoundationDBCluster, processClass string, idNum int) (*corev1.PersistentVolumeClaim, error)
GetPvc builds a persistent volume claim for a FoundationDB instance.
func GetService ¶ added in v0.24.0
func GetService(cluster *fdbtypes.FoundationDBCluster, processClass string, idNum int) (*corev1.Service, error)
GetService builds a service for a new instance
func GetStartCommand ¶
func GetStartCommand(cluster *fdbtypes.FoundationDBCluster, instance FdbInstance, podClient FdbPodClient, processNumber int, processCount int) (string, error)
GetStartCommand builds the expected start command for an instance.
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 MissingPodError ¶
func MissingPodError(instance FdbInstance, cluster *fdbtypes.FoundationDBCluster) error
MissingPodError creates an error that can be thrown when an instance does not have an associated pod.
func MissingPodErrorByName ¶
func MissingPodErrorByName(instanceName string, cluster *fdbtypes.FoundationDBCluster) error
MissingPodErrorByName creates an error that can be thrown when an instance does not have an associated pod.
func NormalizeClusterSpec ¶ added in v0.20.0
func NormalizeClusterSpec(spec *fdbtypes.FoundationDBClusterSpec, options DeprecationOptions) error
NormalizeClusterSpec converts a cluster spec into an unambiguous, future-proof form, by applying any implicit defaults and moving configuration from deprecated fields into fully-supported fields.
func ParseInstanceID ¶
ParseInstanceID extracts the components of an instance ID.
func RemoveAddressFlags ¶ added in v0.23.0
RemoveAddressFlags strips the flags from the end of the addresses, leaving only the IP and port.
func RemoveAddressFlagsFromAll ¶ added in v0.23.0
RemoveAddressFlagsFromAll strips the flags from the end of the addresses, leaving only the IP and port.
func UpdateDynamicFiles ¶
func UpdateDynamicFiles(client FdbPodClient, filename string, contents string, updateFunc func(client FdbPodClient) error) (bool, error)
UpdateDynamicFiles checks if the files in the dynamic conf volume match the expected contents, and tries to copy the latest files from the input volume if they do not.
func ValidateCustomParameters ¶ added in v0.25.0
ValidateCustomParameters ensures that no duplicate values are set and that no protected/forbidden parameters are set. Theoretically we could also check if FDB supports the given parameter.
Types ¶
type AddPods ¶
type AddPods struct{}
AddPods provides a reconciliation step for adding new pods to a cluster.
func (AddPods) Reconcile ¶
func (a AddPods) Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error)
Reconcile runs the reconciler's work.
func (AddPods) RequeueAfter ¶
RequeueAfter returns the delay before we should run the reconciliation again.
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
func (a AddServices) Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error)
Reconcile runs the reconciler's work.
func (AddServices) RequeueAfter ¶ added in v0.14.0
func (a AddServices) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
type AdminClient ¶
type AdminClient interface { // GetStatus gets the database's status GetStatus() (*fdbtypes.FoundationDBStatus, error) // GetMinimalStatus gets a one-line summary of the database's status. GetMinimalStatus() (string, 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 []string) error // IncludeInstances removes processes from the exclusion list and allows // them to take on roles again. IncludeInstances(addresses []string) error // GetExclusions gets a list of the addresses currently excluded from the // database. GetExclusions() ([]string, 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 []string) ([]string, error) // KillProcesses restarts processes KillInstances(addresses []string) error // ChangeCoordinators changes the coordinator set ChangeCoordinators(addresses []string) (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) 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 }
AdminClient describes an interface for running administrative commands on a cluster
func NewCliAdminClient ¶
func NewCliAdminClient(cluster *fdbtypes.FoundationDBCluster, _ client.Client) (AdminClient, error)
NewCliAdminClient generates an Admin client for 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 (true, nil). If reconciliation encounters an error, this should return (false, err). If reconciliation cannot proceed, or if this method has to make a change to the cluster spec, this should return (false, nil). This method will only be called once for a given instance of the reconciler. */ Reconcile(r *FoundationDBBackupReconciler, context ctx.Context, backup *fdbtypes.FoundationDBBackup) (bool, error) /** RequeueAfter returns the delay before we should run the reconciliation again. */ RequeueAfter() time.Duration }
BackupSubReconciler describes a class that does part of the work of reconciliation for a cluster.
type BounceProcesses ¶
type BounceProcesses struct{}
BounceProcesses provides a reconciliation step for bouncing fdbserver processes.
func (BounceProcesses) Reconcile ¶
func (b BounceProcesses) Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error)
Reconcile runs the reconciler's work.
func (BounceProcesses) RequeueAfter ¶
func (b BounceProcesses) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
type ChangeCoordinators ¶
type ChangeCoordinators struct{}
ChangeCoordinators provides a reconciliation step for choosing new coordinators.
func (ChangeCoordinators) Reconcile ¶
func (c ChangeCoordinators) Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error)
Reconcile runs the reconciler's work.
func (ChangeCoordinators) RequeueAfter ¶
func (c ChangeCoordinators) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
type CheckClientCompatibility ¶
type CheckClientCompatibility struct{}
CheckClientCompatibility confirms that all clients are compatible with the version of FoundationDB configured on the cluster.
func (CheckClientCompatibility) Reconcile ¶
func (c CheckClientCompatibility) Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error)
Reconcile runs the reconciler's work.
func (CheckClientCompatibility) RequeueAfter ¶
func (c CheckClientCompatibility) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
type ChooseRemovals ¶
type ChooseRemovals struct{}
ChooseRemovals chooses which processes will be removed during a shrink.
func (ChooseRemovals) Reconcile ¶
func (c ChooseRemovals) Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error)
Reconcile runs the reconciler's work.
func (ChooseRemovals) RequeueAfter ¶
func (c ChooseRemovals) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
type CliAdminClient ¶
type CliAdminClient struct { // Cluster is the reference to the cluster model. Cluster *fdbtypes.FoundationDBCluster // contains filtered or unexported fields }
CliAdminClient provides an implementation of the admin interface using the FDB CLI.
func (*CliAdminClient) CanSafelyRemove ¶
func (client *CliAdminClient) CanSafelyRemove(addresses []string) ([]string, 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.
func (*CliAdminClient) ChangeCoordinators ¶
func (client *CliAdminClient) ChangeCoordinators(addresses []string) (string, error)
ChangeCoordinators changes the coordinator set
func (*CliAdminClient) Close ¶
func (client *CliAdminClient) Close() error
Close cleans up any pending resources.
func (*CliAdminClient) ConfigureDatabase ¶
func (client *CliAdminClient) ConfigureDatabase(configuration fdbtypes.DatabaseConfiguration, newDatabase bool) error
ConfigureDatabase sets the database configuration
func (*CliAdminClient) ExcludeInstances ¶
func (client *CliAdminClient) ExcludeInstances(addresses []string) error
ExcludeInstances starts evacuating processes so that they can be removed from the database.
func (*CliAdminClient) GetBackupStatus ¶ added in v0.10.0
func (client *CliAdminClient) GetBackupStatus() (*fdbtypes.FoundationDBLiveBackupStatus, error)
GetBackupStatus gets the status of the current backup.
func (*CliAdminClient) GetConnectionString ¶ added in v0.5.0
func (client *CliAdminClient) GetConnectionString() (string, error)
GetConnectionString fetches the latest connection string.
func (*CliAdminClient) GetExclusions ¶ added in v0.23.0
func (client *CliAdminClient) GetExclusions() ([]string, error)
GetExclusions gets a list of the addresses currently excluded from the database.
func (*CliAdminClient) GetMinimalStatus ¶ added in v0.21.1
func (client *CliAdminClient) GetMinimalStatus() (string, error)
GetMinimalStatus gets a one-line summary of the database's status.
func (*CliAdminClient) GetProtocolVersion ¶
func (client *CliAdminClient) GetProtocolVersion(version string) (string, error)
GetProtocolVersion determines the protocol version that is used by a version of FDB.
func (*CliAdminClient) GetRestoreStatus ¶ added in v0.11.0
func (client *CliAdminClient) GetRestoreStatus() (string, error)
GetRestoreStatus gets the status of the current restore.
func (*CliAdminClient) GetStatus ¶
func (client *CliAdminClient) GetStatus() (*fdbtypes.FoundationDBStatus, error)
GetStatus gets the database's status
func (*CliAdminClient) IncludeInstances ¶
func (client *CliAdminClient) IncludeInstances(addresses []string) error
IncludeInstances removes processes from the exclusion list and allows them to take on roles again.
func (*CliAdminClient) KillInstances ¶
func (client *CliAdminClient) KillInstances(addresses []string) error
KillInstances restarts processes
func (*CliAdminClient) ModifyBackup ¶ added in v0.10.0
func (client *CliAdminClient) ModifyBackup(snapshotPeriodSeconds int) error
ModifyBackup updates the backup parameters.
func (*CliAdminClient) PauseBackups ¶ added in v0.9.0
func (client *CliAdminClient) PauseBackups() error
PauseBackups pauses the backups.
func (*CliAdminClient) ResumeBackups ¶ added in v0.9.0
func (client *CliAdminClient) ResumeBackups() error
ResumeBackups resumes the backups.
func (*CliAdminClient) StartBackup ¶ added in v0.8.0
func (client *CliAdminClient) StartBackup(url string, snapshotPeriodSeconds int) error
StartBackup starts a new backup.
func (*CliAdminClient) StartRestore ¶ added in v0.11.0
func (client *CliAdminClient) StartRestore(url string) error
StartRestore starts a new restore.
func (*CliAdminClient) StopBackup ¶ added in v0.9.0
func (client *CliAdminClient) StopBackup(url string) error
StopBackup stops a backup.
func (*CliAdminClient) VersionSupported ¶
func (client *CliAdminClient) VersionSupported(versionString string) (bool, error)
VersionSupported reports whether we can support a cluster with a given version.
type ClusterSubReconciler ¶ added in v0.7.0
type ClusterSubReconciler interface { /** Reconcile runs the reconciler's work. If reconciliation can continue, this should return (true, nil). If reconciliation encounters an error, this should return (false, err). If reconciliation cannot proceed, or if this method has to make a change to the cluster spec, this should return (false, nil). This method will only be called once for a given instance of the reconciler, so you can safely store */ Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error) /** RequeueAfter returns the delay before we should run the reconciliation again. */ RequeueAfter() time.Duration }
ClusterSubReconciler describes a class that does part of the work of reconciliation for a cluster.
type ConfirmExclusionCompletion ¶ added in v0.17.0
type ConfirmExclusionCompletion struct{}
ConfirmExclusionCompletion provides a reconciliation step for checking whether exclusions have completed.
func (ConfirmExclusionCompletion) Reconcile ¶ added in v0.17.0
func (c ConfirmExclusionCompletion) Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error)
Reconcile runs the reconciler's work.
func (ConfirmExclusionCompletion) RequeueAfter ¶ added in v0.17.0
func (c ConfirmExclusionCompletion) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
type DeprecationOptions ¶ added in v0.22.0
type DeprecationOptions struct { // Whether we should apply the latest defaults rather than the defaults that // were initially established for this major version. UseFutureDefaults bool // Whether we should only fill in defaults that have changes between major // versions of the operator. OnlyShowChanges bool }
DeprecationOptions controls how deprecations and changes to defaults get applied to our specs.
type ExcludeInstances ¶
type ExcludeInstances struct{}
ExcludeInstances provides a reconciliation step for excluding instances from the database.
func (ExcludeInstances) Reconcile ¶
func (e ExcludeInstances) Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error)
Reconcile runs the reconciler's work.
func (ExcludeInstances) RequeueAfter ¶
func (e ExcludeInstances) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
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() string
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 FdbPodClient ¶
type FdbPodClient interface { // GetCluster returns the cluster associated with a client GetCluster() *fdbtypes.FoundationDBCluster // GetPod returns the pod associated with a client GetPod() *corev1.Pod // IsPresent checks whether a file in the sidecar is present IsPresent(filename string) (bool, error) // CheckHash checks whether a file in the sidecar has the expected contents. CheckHash(filename string, contents string) (bool, error) // GenerateMonitorConf updates the monitor conf file for a pod GenerateMonitorConf() error // CopyFiles copies the files from the config map to the shared dynamic conf // volume CopyFiles() error // GetVariableSubstitutions gets the current keys and values that this // instance will substitute into its monitor conf. GetVariableSubstitutions() (map[string]string, error) }
FdbPodClient provides methods for working with a FoundationDB pod
func NewFdbPodClient ¶
func NewFdbPodClient(cluster *fdbtypes.FoundationDBCluster, pod *corev1.Pod) (FdbPodClient, error)
NewFdbPodClient builds a client for working with an FDB Pod
func NewMockFdbPodClient ¶
func NewMockFdbPodClient(cluster *fdbtypes.FoundationDBCluster, pod *corev1.Pod) (FdbPodClient, error)
NewMockFdbPodClient builds a mock client for working with an FDB pod
type FoundationDBBackupReconciler ¶ added in v0.7.0
type FoundationDBBackupReconciler struct { client.Client Recorder record.EventRecorder Log logr.Logger Scheme *runtime.Scheme InSimulation bool 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
Reconcile runs the reconciliation logic.
func (*FoundationDBBackupReconciler) SetupWithManager ¶ added in v0.7.0
func (r *FoundationDBBackupReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager prepares a reconciler for use.
type FoundationDBClusterReconciler ¶
type FoundationDBClusterReconciler struct { client.Client Recorder record.EventRecorder Log logr.Logger Scheme *runtime.Scheme InSimulation bool PodLifecycleManager PodLifecycleManager PodClientProvider func(*fdbtypes.FoundationDBCluster, *corev1.Pod) (FdbPodClient, error) PodIPProvider func(*corev1.Pod) string AdminClientProvider func(*fdbtypes.FoundationDBCluster, client.Client) (AdminClient, error) LockClientProvider LockClientProvider UseFutureDefaults bool Namespace string DeprecationOptions DeprecationOptions }
FoundationDBClusterReconciler reconciles a FoundationDBCluster object
func (*FoundationDBClusterReconciler) CheckDeprecations ¶ added in v0.22.0
func (r *FoundationDBClusterReconciler) CheckDeprecations(context ctx.Context) error
CheckDeprecations checks for any deprecated clusters in the controller's scope.
func (*FoundationDBClusterReconciler) GetDeprecations ¶ added in v0.22.0
func (r *FoundationDBClusterReconciler) GetDeprecations(context ctx.Context) ([]fdbtypes.FoundationDBCluster, error)
GetDeprecations returns a list of clusters that have deprecated options in their specs.
func (*FoundationDBClusterReconciler) SetupWithManager ¶
func (r *FoundationDBClusterReconciler) SetupWithManager(mgr ctrl.Manager) 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 Scheme *runtime.Scheme InSimulation bool 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
Reconcile runs the reconciliation logic.
func (*FoundationDBRestoreReconciler) SetupWithManager ¶ added in v0.11.0
func (r *FoundationDBRestoreReconciler) SetupWithManager(mgr ctrl.Manager) 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 ¶
func (g GenerateInitialClusterFile) Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error)
Reconcile runs the reconciler's work.
func (GenerateInitialClusterFile) RequeueAfter ¶
func (g GenerateInitialClusterFile) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
type InvalidLockValue ¶ added in v0.13.0
type InvalidLockValue struct {
// contains filtered or unexported fields
}
InvalidLockValue is an error we can return when we cannot parse the existing values in the locking system.
func (InvalidLockValue) Error ¶ added in v0.13.0
func (err InvalidLockValue) Error() string
Error formats the error message.
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) }
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.
func NewRealLockClient ¶ added in v0.13.0
func NewRealLockClient(cluster *fdbtypes.FoundationDBCluster) (LockClient, error)
NewRealLockClient creates a 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.
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 []string) ([]string, 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 []string) (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 []string) 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) GetExclusions ¶ added in v0.23.0
func (client *MockAdminClient) GetExclusions() ([]string, error)
GetExclusions gets a list of the addresses currently excluded from the database.
func (*MockAdminClient) GetMinimalStatus ¶ added in v0.21.1
func (client *MockAdminClient) GetMinimalStatus() (string, error)
GetMinimalStatus gets a one-line summary of the database's status.
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 []string) error
IncludeInstances removes instances from the exclusion list and allows them to take on roles again.
func (*MockAdminClient) KillInstances ¶
func (client *MockAdminClient) KillInstances(addresses []string) error
KillInstances restarts processes
func (*MockAdminClient) MockClientVersion ¶ added in v0.16.0
func (client *MockAdminClient) MockClientVersion(version string, clients []string)
MockClientVersion returns a mocked client version
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) 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) Disabled ¶ added in v0.24.0
func (client *MockLockClient) Disabled() bool
Disabled determines if the client should automatically grant locks.
func (*MockLockClient) TakeLock ¶ added in v0.13.0
func (client *MockLockClient) TakeLock() (bool, error)
TakeLock attempts to acquire a lock.
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
func (s ModifyBackup) Reconcile(r *FoundationDBBackupReconciler, context ctx.Context, backup *fdbtypes.FoundationDBBackup) (bool, error)
Reconcile runs the reconciler's work.
func (ModifyBackup) RequeueAfter ¶ added in v0.10.0
func (s ModifyBackup) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
type PodLifecycleManager ¶
type PodLifecycleManager interface { // GetInstances lists the instances in the cluster GetInstances(*FoundationDBClusterReconciler, *fdbtypes.FoundationDBCluster, ctx.Context, ...client.ListOption) ([]FdbInstance, error) // CreateInstance creates a new instance based on a pod definition CreateInstance(*FoundationDBClusterReconciler, ctx.Context, *corev1.Pod) error // DeleteInstance shuts down an instance DeleteInstance(*FoundationDBClusterReconciler, ctx.Context, FdbInstance) error // CanDeletePods checks whether it is safe to delete pods. CanDeletePods(*FoundationDBClusterReconciler, ctx.Context, *fdbtypes.FoundationDBCluster) (bool, error) // UpdatePods updates a list of pods to match the latest specs. UpdatePods(*FoundationDBClusterReconciler, ctx.Context, *fdbtypes.FoundationDBCluster, []FdbInstance) error // UpdateImageVersion updates a container's image. UpdateImageVersion(*FoundationDBClusterReconciler, ctx.Context, *fdbtypes.FoundationDBCluster, FdbInstance, int, string) error // UpdateMetadata updates an instance's metadata. UpdateMetadata(*FoundationDBClusterReconciler, 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(*FoundationDBClusterReconciler, ctx.Context, *fdbtypes.FoundationDBCluster, FdbInstance) (bool, error) }
PodLifecycleManager provides an abstraction around created pods to allow using intermediary replication controllers that will manager the basic pod lifecycle.
type RealLockClient ¶ added in v0.13.0
type RealLockClient struct {
// contains filtered or unexported fields
}
RealLockClient provides a client for managing operation locks through the database.
func (*RealLockClient) Disabled ¶ added in v0.24.0
func (client *RealLockClient) Disabled() bool
Disabled determines if the client should automatically grant locks.
func (*RealLockClient) TakeLock ¶ added in v0.13.0
func (client *RealLockClient) TakeLock() (bool, error)
TakeLock attempts to acquire a lock.
type ReconciliationNotReadyError ¶
type ReconciliationNotReadyError struct {
// contains filtered or unexported fields
}
ReconciliationNotReadyError is returned when reconciliation cannot proceed because of a temporary condition or because automation is disabled
func (ReconciliationNotReadyError) Error ¶
func (err ReconciliationNotReadyError) Error() string
type RemovePods ¶
type RemovePods struct{}
RemovePods provides a reconciliation step for removing pods as part of a shrink or replacement.
func (RemovePods) Reconcile ¶
func (u RemovePods) Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error)
Reconcile runs the reconciler's work.
func (RemovePods) RequeueAfter ¶
func (u RemovePods) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
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
func (u RemoveServices) Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error)
Reconcile runs the reconciler's work.
func (RemoveServices) RequeueAfter ¶ added in v0.14.0
func (u RemoveServices) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
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
func (c ReplaceMisconfiguredPods) Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error)
Reconcile runs the reconciler's work.
func (ReplaceMisconfiguredPods) RequeueAfter ¶ added in v0.9.0
func (c ReplaceMisconfiguredPods) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
type RestoreSubReconciler ¶ added in v0.11.0
type RestoreSubReconciler interface { /** Reconcile runs the reconciler's work. If reconciliation can continue, this should return (true, nil). If reconciliation encounters an error, this should return (false, err). If reconciliation cannot proceed, or if this method has to make a change to the restore spec, this should return (false, nil). This method will only be called once for a given instance of the reconciler. */ Reconcile(r *FoundationDBRestoreReconciler, context ctx.Context, restore *fdbtypes.FoundationDBRestore) (bool, error) /** RequeueAfter returns the delay before we should run the reconciliation again. */ RequeueAfter() time.Duration }
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(r *FoundationDBClusterReconciler, 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 *FoundationDBClusterReconciler, 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 *FoundationDBClusterReconciler, context ctx.Context, instance FdbInstance) error
DeleteInstance shuts down an instance
func (StandardPodLifecycleManager) GetInstances ¶
func (manager StandardPodLifecycleManager) GetInstances(r *FoundationDBClusterReconciler, 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
func (manager StandardPodLifecycleManager) InstanceIsUpdated(*FoundationDBClusterReconciler, ctx.Context, *fdbtypes.FoundationDBCluster, FdbInstance) (bool, 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.
func (StandardPodLifecycleManager) UpdateImageVersion ¶ added in v0.10.0
func (manager StandardPodLifecycleManager) UpdateImageVersion(r *FoundationDBClusterReconciler, 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 *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster, instance FdbInstance) error
UpdateMetadata updates an instance's metadata.
func (StandardPodLifecycleManager) UpdatePods ¶
func (manager StandardPodLifecycleManager) UpdatePods(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster, instances []FdbInstance) 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
func (s StartBackup) Reconcile(r *FoundationDBBackupReconciler, context ctx.Context, backup *fdbtypes.FoundationDBBackup) (bool, error)
Reconcile runs the reconciler's work.
func (StartBackup) RequeueAfter ¶ added in v0.8.0
func (s StartBackup) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
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
func (s StartRestore) Reconcile(r *FoundationDBRestoreReconciler, context ctx.Context, restore *fdbtypes.FoundationDBRestore) (bool, error)
Reconcile runs the reconciler's work.
func (StartRestore) RequeueAfter ¶ added in v0.11.0
func (s StartRestore) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
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
func (s StopBackup) Reconcile(r *FoundationDBBackupReconciler, context ctx.Context, backup *fdbtypes.FoundationDBBackup) (bool, error)
Reconcile runs the reconciler's work.
func (StopBackup) RequeueAfter ¶ added in v0.9.0
func (s StopBackup) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
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
func (s ToggleBackupPaused) Reconcile(r *FoundationDBBackupReconciler, context ctx.Context, backup *fdbtypes.FoundationDBBackup) (bool, error)
Reconcile runs the reconciler's work.
func (ToggleBackupPaused) RequeueAfter ¶ added in v0.9.0
func (s ToggleBackupPaused) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
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
func (u UpdateBackupAgents) Reconcile(r *FoundationDBBackupReconciler, context ctx.Context, backup *fdbtypes.FoundationDBBackup) (bool, error)
Reconcile runs the reconciler's work.
func (UpdateBackupAgents) RequeueAfter ¶ added in v0.7.0
func (u UpdateBackupAgents) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
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
func (s UpdateBackupStatus) Reconcile(r *FoundationDBBackupReconciler, context ctx.Context, backup *fdbtypes.FoundationDBBackup) (bool, error)
Reconcile runs the reconciler's work.
func (UpdateBackupStatus) RequeueAfter ¶ added in v0.7.0
func (s UpdateBackupStatus) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
type UpdateConfigMap ¶
type UpdateConfigMap struct{}
UpdateConfigMap provides a reconciliation step for updating the dynamic conf for a cluster.
func (UpdateConfigMap) Reconcile ¶
func (u UpdateConfigMap) Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error)
Reconcile runs the reconciler's work.
func (UpdateConfigMap) RequeueAfter ¶
func (u UpdateConfigMap) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
type UpdateDatabaseConfiguration ¶
type UpdateDatabaseConfiguration struct{}
UpdateDatabaseConfiguration provides a reconciliation step for changing the database configuration.
func (UpdateDatabaseConfiguration) Reconcile ¶
func (u UpdateDatabaseConfiguration) Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error)
Reconcile runs the reconciler's work.
func (UpdateDatabaseConfiguration) RequeueAfter ¶
func (u UpdateDatabaseConfiguration) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
type UpdateLabels ¶
type UpdateLabels struct{}
UpdateLabels provides a reconciliation step for updating the labels on pods.
func (UpdateLabels) Reconcile ¶
func (u UpdateLabels) Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error)
Reconcile runs the reconciler's work.
func (UpdateLabels) RequeueAfter ¶
func (u UpdateLabels) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
type UpdatePods ¶
type UpdatePods struct{}
UpdatePods provides a reconciliation step for recreating pods with new pod specs.
func (UpdatePods) Reconcile ¶
func (u UpdatePods) Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error)
Reconcile runs the reconciler's work.
func (UpdatePods) RequeueAfter ¶
func (u UpdatePods) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
type UpdateSidecarVersions ¶
type UpdateSidecarVersions struct { }
UpdateSidecarVersions provides a reconciliation step for upgrading the sidecar.
func (UpdateSidecarVersions) Reconcile ¶
func (u UpdateSidecarVersions) Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error)
Reconcile runs the reconciler's work.
func (UpdateSidecarVersions) RequeueAfter ¶
func (u UpdateSidecarVersions) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
type UpdateStatus ¶
type UpdateStatus struct { }
UpdateStatus provides a reconciliation step for updating the status in the CRD.
func (UpdateStatus) Reconcile ¶
func (s UpdateStatus) Reconcile(r *FoundationDBClusterReconciler, context ctx.Context, cluster *fdbtypes.FoundationDBCluster) (bool, error)
Reconcile runs the reconciler's work.
func (UpdateStatus) RequeueAfter ¶
func (s UpdateStatus) RequeueAfter() time.Duration
RequeueAfter returns the delay before we should run the reconciliation again.
Source Files ¶
- add_pods.go
- add_services.go
- admin_client.go
- backup_controller.go
- bounce_processes.go
- change_coordinators.go
- check_client_compatibility.go
- choose_removals.go
- cluster_controller.go
- confirm_exclusion_completion.go
- controllers.go
- exclude_instances.go
- generate_initial_cluster_file.go
- lock_client.go
- metrics.go
- modify_backup.go
- pod_client.go
- pod_models.go
- remove_pods.go
- remove_services.go
- replace_misconfigured_pods.go
- restore_controller.go
- start_backup.go
- start_restore.go
- stop_backup.go
- toggle_backup_paused.go
- update_backup_agents.go
- update_backup_status.go
- update_config_map.go
- update_database_configuration.go
- update_labels.go
- update_pods.go
- update_sidecar_versions.go
- update_status.go