Documentation
¶
Index ¶
Constants ¶
const (
ControllerName = "OrphanedPVController"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller watches all PVs actively belonging to a ScyllaDBDatacenter and replace scylla node on any PV that is orphaned, if enabled on the ScyllaDBDatacenter. Orphaned PV is a volume that is hard bound to a node that doesn't exist anymore. The controller is based on a ScyllaDBDatacenter key and listing matching PVs because using a PV key and trying to find a corresponding ScyllaDBDatacenter would be quite hard, there are no ownerRefs and we can't propagate the "enabled" information from a ScyllaDBDatacenter to a PVC annotation because PVCs are not reconciled. TODO: When we support auto-replacing nodes, we could replace it with generic controller
deleting PVs bound to nodes that don't exists anymore, without knowing about ScyllaDBDatacenter. It would also process PVs instead of ScyllaDBDatacenter which is currently complicating the logic that has to handle multiple PVs at once, artificial requeues / not watching PVs and different error paths.
func NewController ¶
func NewController( kubeClient kubernetes.Interface, pvInformer corev1informers.PersistentVolumeInformer, pvcInformer corev1informers.PersistentVolumeClaimInformer, nodeInformer corev1informers.NodeInformer, scyllaDBDatacenterInformer scyllav1alpha1informers.ScyllaDBDatacenterInformer, ) (*Controller, error)
type PVItem ¶
type PVItem struct { PV *corev1.PersistentVolume ServiceName string }