Documentation ¶
Index ¶
Constants ¶
View Source
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 ScyllaCluster and replace scylla node on any PV that is orphaned, if enabled on the ScyllaCluster. Orphaned PV is a volume that is hard bound to a node that doesn't exist anymore. The controller is based on a ScyllaCluster key and listing matching PVs because using a PV key and trying to find a corresponding ScyllaCluster would be quite hard, there are no ownerRefs and we can't propagate the "enabled" information from a ScyllaCluster 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 ScyllaClusters. It would also process PVs instead of ScyllaClusters 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, scyllaClusterInformer scyllav1informers.ScyllaClusterInformer, ) (*Controller, error)
type PVItem ¶
type PVItem struct { PV *corev1.PersistentVolume ServiceName string }
Click to show internal directories.
Click to hide internal directories.