Documentation
¶
Index ¶
- func BuildRoleBindingForBackupConfig(cluster *cnpgv1.Cluster) *rbacv1.RoleBinding
- func BuildRoleForBackupConfigs(role *rbacv1.Role, cluster *cnpgv1.Cluster, ...)
- func GetRoleNameForBackupConfig(clusterName string) string
- type BackupConfigReconciler
- type BackupDeletionController
- func (b *BackupDeletionController) EnqueueBackupConfigDeletion(ctx context.Context, backupConfig *v1beta1.BackupConfig) error
- func (b *BackupDeletionController) EnqueueBackupDeletion(ctx context.Context, backup *cnpgv1.Backup) error
- func (b *BackupDeletionController) Start(ctx context.Context) error
- type BackupReconciler
- type ConfigMapReconciler
- type DeletionRequest
- type ResourceType
- type RetentionController
- type SecretReconciler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildRoleBindingForBackupConfig ¶
func BuildRoleBindingForBackupConfig( cluster *cnpgv1.Cluster, ) *rbacv1.RoleBinding
BuildRoleBinding builds the role binding object for this cluster
func BuildRoleForBackupConfigs ¶
func BuildRoleForBackupConfigs( role *rbacv1.Role, cluster *cnpgv1.Cluster, backupConfigs []v1beta1.BackupConfig, )
BuildRole builds the Role object for this cluster It collects all BackupConfig objects used by cluster and grants read/watch permissions on them only It also finds all secrets referenced by these BackupConfig and grants read permission on them
func GetRoleNameForBackupConfig ¶ added in v0.2.0
GetRBACName returns the name of the RBAC entities for the wal-g backup configs
Types ¶
type BackupConfigReconciler ¶
type BackupConfigReconciler struct {
client.Client
Scheme *runtime.Scheme
BackupDeletionController *BackupDeletionController
}
BackupConfigReconciler reconciles a BackupConfig object
func (*BackupConfigReconciler) Reconcile ¶
func (r *BackupConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.20.4/pkg/reconcile
func (*BackupConfigReconciler) SetupWithManager ¶
func (r *BackupConfigReconciler) SetupWithManager(mgr ctrl.Manager, backupDeletionController *BackupDeletionController) error
SetupWithManager sets up the controller with the Manager.
type BackupDeletionController ¶ added in v0.2.0
BackupDeletionController handles Backup and BackupConfig deletion requests and processes them sequentially per BackupConfig to prevent operator from overloading and wal-g collisions at deleting backups at the same storage
func NewBackupDeletionController ¶ added in v0.2.0
func NewBackupDeletionController(client client.Client) *BackupDeletionController
NewBackupDeletionController creates a new BackupDeletionController
func (*BackupDeletionController) EnqueueBackupConfigDeletion ¶ added in v0.2.2
func (b *BackupDeletionController) EnqueueBackupConfigDeletion(ctx context.Context, backupConfig *v1beta1.BackupConfig) error
EnqueueBackupConfigDeletion adds a BackupConfig to the deletion queue If the queue doesn't exist, it creates a new one and starts a goroutine to process it
func (*BackupDeletionController) EnqueueBackupDeletion ¶ added in v0.2.0
func (b *BackupDeletionController) EnqueueBackupDeletion(ctx context.Context, backup *cnpgv1.Backup) error
EnqueueBackupDeletion adds a Backup to the deletion queue for its BackupConfig If the queue doesn't exist, it creates a new one and starts a goroutine to process it
type BackupReconciler ¶ added in v0.2.0
type BackupReconciler struct {
client.Client
Scheme *runtime.Scheme
DeletionController *BackupDeletionController
}
BackupReconciler reconciles a Backup object
func (*BackupReconciler) SetupWithManager ¶ added in v0.2.0
func (r *BackupReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ConfigMapReconciler ¶ added in v0.2.2
ConfigMapReconciler reconciles ConfigMap objects to protect them from accidental deletion when they are referenced by BackupConfig resources
func (*ConfigMapReconciler) SetupWithManager ¶ added in v0.2.2
func (r *ConfigMapReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type DeletionRequest ¶ added in v0.2.2
type DeletionRequest struct {
// Type of resource to delete
Type ResourceType
// NamespacedName of the resource
Key types.NamespacedName
}
DeletionRequest represents a request to delete a resource
type ResourceType ¶ added in v0.2.2
type ResourceType string
ResourceType defines the type of resource being deleted
const ( // ResourceTypeBackup represents a Backup resource ResourceTypeBackup ResourceType = "Backup" // ResourceTypeBackupConfig represents a BackupConfig resource ResourceTypeBackupConfig ResourceType = "BackupConfig" // Timeout for resource cleanup, if exceeded - deletion process will be aborted and retried // Needed to prevent stuck on deletion when incorrect BackupConfig / etc. DeletionRequestTimeout time.Duration = 10 * time.Minute )
type RetentionController ¶ added in v0.2.0
type RetentionController struct {
// contains filtered or unexported fields
}
RetentionController periodically checks all BackupConfig resources and applies retention policies to delete old backups
func NewRetentionController ¶ added in v0.2.0
func NewRetentionController(client client.Client, checkInterval time.Duration) *RetentionController
NewRetentionController creates a new RetentionController
type SecretReconciler ¶ added in v0.2.2
SecretReconciler reconciles Secret objects to protect them from accidental deletion when they are referenced by BackupConfig resources
func (*SecretReconciler) SetupWithManager ¶ added in v0.2.2
func (r *SecretReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.