controller

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MantleBackupFinalizerName = "mantlebackup.mantle.cybozu.io/finalizer"

	MantleExportJobPrefix     = "mantle-export-"
	MantleUploadJobPrefix     = "mantle-upload-"
	MantleExportDataPVCPrefix = "mantle-export-"
	MantleImportJobPrefix     = "mantle-import-"
	MantleDiscardJobPrefix    = "mantle-discard-"
	MantleDiscardPVCPrefix    = "mantle-discard-"
	MantleDiscardPVPrefix     = "mantle-discard-"
)
View Source
const (
	MantleBackupConfigFinalizerName     = "mantlebackupconfig.mantle.cybozu.io/finalizer"
	MantleBackupConfigCronJobNamePrefix = "mbc-"
)
View Source
const (
	MantleRestoreFinalizerName      = "mantlerestore.mantle.cybozu.io/finalizer"
	RestoringPVFinalizerName        = "mantle.cybozu.io/restoring-pv-finalizer"
	PVAnnotationRestoredBy          = "mantle.cybozu.io/restored-by"
	PVAnnotationRestoredByName      = "mantle.cybozu.io/restored-by-name"
	PVAnnotationRestoredByNamespace = "mantle.cybozu.io/restored-by-namespace"
	PVCAnnotationRestoredBy         = "mantle.cybozu.io/restored-by"
)
View Source
const (
	RoleStandalone = "standalone"
	RolePrimary    = "primary"
	RoleSecondary  = "secondary"
)

Variables

This section is empty.

Functions

func IsJobConditionTrue added in v0.2.0

func IsJobConditionTrue(conditions []batchv1.JobCondition, conditionType batchv1.JobConditionType) bool

IsJobConditionTrue returns true when the conditionType is present and set to `metav1.ConditionTrue`. Otherwise, it returns false. Note that we can't use meta.IsStatusConditionTrue because it doesn't accept []JobCondition.

func MakeDiscardJobName added in v0.3.1

func MakeDiscardJobName(target *mantlev1.MantleBackup) string

func MakeDiscardPVCName added in v0.3.1

func MakeDiscardPVCName(target *mantlev1.MantleBackup) string

func MakeDiscardPVName added in v0.3.1

func MakeDiscardPVName(target *mantlev1.MantleBackup) string

func MakeExportDataPVCName added in v0.3.1

func MakeExportDataPVCName(target *mantlev1.MantleBackup) string

func MakeExportJobName added in v0.3.1

func MakeExportJobName(target *mantlev1.MantleBackup) string

func MakeImportJobName added in v0.3.1

func MakeImportJobName(target *mantlev1.MantleBackup) string

func MakeObjectNameOfExportedData added in v0.3.1

func MakeObjectNameOfExportedData(name, uid string) string

func MakeUploadJobName added in v0.3.1

func MakeUploadJobName(target *mantlev1.MantleBackup) string

Types

type GarbageCollectorRunner added in v0.2.0

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

func NewGarbageCollectorRunner added in v0.2.0

func NewGarbageCollectorRunner(
	client client.Client,
	interval time.Duration,
	managedCephClusterID string,
) *GarbageCollectorRunner

func (*GarbageCollectorRunner) Start added in v0.2.0

type MantleBackupConfigReconciler added in v0.2.0

type MantleBackupConfigReconciler struct {
	Client client.Client
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

MantleBackupConfigReconciler reconciles a MantleBackupConfig object

func NewMantleBackupConfigReconciler added in v0.2.0

func NewMantleBackupConfigReconciler(
	cli client.Client,
	scheme *runtime.Scheme,
	managedCephClusterID string,
	overwriteMBCSchedule string,
	role string,
) *MantleBackupConfigReconciler

func (*MantleBackupConfigReconciler) Reconcile added in v0.2.0

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the MantleBackupConfig object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

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

func (*MantleBackupConfigReconciler) SetupWithManager added in v0.2.0

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

SetupWithManager sets up the controller with the Manager.

type MantleBackupReconciler

type MantleBackupReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

MantleBackupReconciler reconciles a MantleBackup object

func NewMantleBackupReconciler

func NewMantleBackupReconciler(
	client client.Client,
	scheme *runtime.Scheme,
	managedCephClusterID,
	role string,
	primarySettings *PrimarySettings,
	podImage string,
	envSecret string,
	objectStorageSettings *ObjectStorageSettings,
	proxySettings *ProxySettings,
) *MantleBackupReconciler

NewMantleBackupReconciler returns NodeReconciler.

func (*MantleBackupReconciler) Reconcile

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

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the MantleBackup object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

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

func (*MantleBackupReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type MantleRestoreReconciler added in v0.2.0

type MantleRestoreReconciler struct {
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

MantleRestoreReconciler reconciles a MantleRestore object

func NewMantleRestoreReconciler added in v0.2.0

func NewMantleRestoreReconciler(
	client client.Client,
	scheme *runtime.Scheme,
	managedCephClusterID,
	role string,
) *MantleRestoreReconciler

func (*MantleRestoreReconciler) Reconcile added in v0.2.0

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

func (*MantleRestoreReconciler) SetupWithManager added in v0.2.0

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

SetupWithManager sets up the controller with the Manager.

type MantleRestoreReconcilerE2E added in v0.2.0

type MantleRestoreReconcilerE2E struct {
	MantleRestoreReconciler
}

MantleRestoreReconcilerE2E is a wrapper of MantleRestoreReconciler this module is for testing cloneImageFromBackup and removeRBDImage in e2e tests

func NewMantleRestoreReconcilerE2E added in v0.2.0

func NewMantleRestoreReconcilerE2E(managedCephClusterID, toolsNamespace string) *MantleRestoreReconcilerE2E

func (*MantleRestoreReconcilerE2E) CloneImageFromBackup added in v0.2.0

func (r *MantleRestoreReconcilerE2E) CloneImageFromBackup(ctx context.Context, restore *mantlev1.MantleRestore, backup *mantlev1.MantleBackup) error

type ObjectStorageSettings added in v0.2.0

type ObjectStorageSettings struct {
	CACertConfigMap *string
	CACertKey       *string
	BucketName      string
	Endpoint        string
}

type PersistentVolumeReconciler added in v0.2.0

type PersistentVolumeReconciler struct {
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

PersistentVolumeReconciler reconciles a PersistentVolume object

func NewPersistentVolumeReconciler added in v0.2.0

func NewPersistentVolumeReconciler(
	client client.Client,
	scheme *runtime.Scheme,
	managedCephClusterID string,
) *PersistentVolumeReconciler

func (*PersistentVolumeReconciler) Reconcile added in v0.2.0

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the PersistentVolume object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

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

func (*PersistentVolumeReconciler) SetupWithManager added in v0.2.0

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

SetupWithManager sets up the controller with the Manager.

type PersistentVolumeReconcilerE2E added in v0.2.0

type PersistentVolumeReconcilerE2E struct {
	PersistentVolumeReconciler
}

PersistentVolumeReconcilerE2E is a wrapper of PersistentVolumeReconciler. This module is used to test removeRBDImage in e2e tests.

func NewPersistentVolumeReconcilerE2E added in v0.2.0

func NewPersistentVolumeReconcilerE2E(toolsNamespace string) *PersistentVolumeReconcilerE2E

func (*PersistentVolumeReconcilerE2E) RemoveRBDImage added in v0.2.0

type PrimarySettings added in v0.2.0

type PrimarySettings struct {
	ServiceEndpoint        string
	Conn                   *grpc.ClientConn
	Client                 proto.MantleServiceClient
	MaxExportJobs          int
	ExportDataStorageClass string
}

type ProxySettings added in v0.2.1

type ProxySettings struct {
	HttpProxy  string
	HttpsProxy string
	NoProxy    string
}

type SecondaryServer added in v0.2.0

type SecondaryServer struct {
	proto.UnimplementedMantleServiceServer
	// contains filtered or unexported fields
}

func NewSecondaryServer added in v0.2.0

func NewSecondaryServer(client client.Client, reader client.Reader) *SecondaryServer

func (*SecondaryServer) CreateOrUpdateMantleBackup added in v0.2.0

func (*SecondaryServer) CreateOrUpdatePVC added in v0.2.0

func (*SecondaryServer) ListMantleBackup added in v0.2.0

func (*SecondaryServer) SetSynchronizing added in v0.2.0

Directories

Path Synopsis
internal
objectstorage
Package objectstorage is a generated GoMock package.
Package objectstorage is a generated GoMock package.

Jump to

Keyboard shortcuts

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