statefulset

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const FailedLabel = "sts-resize.vshn.net/failed"

FailedLabel is a label for failed sts resizing that need human interaction

View Source
const PvcAnnotation = "sts-resize.vshn.net/pvcs"

PvcAnnotation is an annotation in which the initial state of the pvcs is stored in

View Source
const ReplicasAnnotation = "sts-resize.vshn.net/replicas"

ReplicasAnnotation stores the initial number of replicas before scaling down the StatefulSet.

View Source
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) Failed

func (s Entity) Failed() bool

Failed returns wether we previously failed to resize this statefulset

func (*Entity) PrepareScaleDown

func (s *Entity) PrepareScaleDown() bool

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

func (s Entity) PrepareScaleUp() (bool, error)

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

func (s Entity) Resizing() bool

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

Jump to

Keyboard shortcuts

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