Documentation ¶
Index ¶
Constants ¶
const FailedLabel = "sts-resize.vshn.net/failed"
FailedLabel is a label for failed sts resizing that need human interaction
const PvcAnnotation = "sts-resize.vshn.net/pvcs"
PvcAnnotation is an annotation in which the initial state of the pvcs is stored in
const ReplicasAnnotation = "sts-resize.vshn.net/replicas"
ReplicasAnnotation stores the initial number of replicas before scaling down the StatefulSet.
const ScaleUpAnnotation = "sts-resize.vshn.net/scalup"
ScaleUpAnnotation marks a replica as in the process of scaling back up and prevents the controller from scaling it down.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entity ¶
type Entity struct { Old *appsv1.StatefulSet Pvcs []pvc.Entity // contains filtered or unexported fields }
Entity contains all data to manage a statfulset resizing
func NewEntity ¶
func NewEntity(sts *appsv1.StatefulSet) (*Entity, error)
NewEntity return a new StatefulSet Info
func (*Entity) PrepareScaleDown ¶
PrepareScaleDown changes the replica to 0, if applicable. It saves the original state and returns true if it ran successfully before and the StatefulSet is scaled to 0.
func (Entity) PrepareScaleUp ¶
PrepareScaleUp updates the replica count to the original replicas. Returns true if it ran successfully before and the StatefulSet is scaled up.
func (Entity) Resizing ¶
Resizing returns wether we are resizing or should be resizing this statefulset
func (Entity) SetFailed ¶
func (s Entity) SetFailed()
SetFailed sets this statefulset to a failed state
func (*Entity) StatefulSet ¶
func (s *Entity) StatefulSet() (*appsv1.StatefulSet, error)
StatefulSet returns the updated StatefulSet resource