helper

package
v0.4.1-0...-6a09f1e Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeleteSlotsAnn = "delete-slots"
)
View Source
const (
	// UpgradeToAdvancedStatefulSetAnn represents the annotation key used to
	// help migration to Advanced StatefulSet
	UpgradeToAdvancedStatefulSetAnn = "apps.pingcap.com/upgrade-to-asts"
)

Variables

This section is empty.

Functions

func AddDeleteSlots

func AddDeleteSlots(set metav1.Object, deleteSlots sets.Int32) (err error)

func FromBuiltinStatefulSet

func FromBuiltinStatefulSet(sts *appsv1.StatefulSet) (*asv1.StatefulSet, error)

func GetDeleteSlots

func GetDeleteSlots(set metav1.Object) (deleteSlots sets.Int32)

func GetMaxPodOrdinal

func GetMaxPodOrdinal(replicas int32, set metav1.Object) int32

func GetMaxReplicaCountAndDeleteSlots

func GetMaxReplicaCountAndDeleteSlots(replicas int32, deleteSlots sets.Int32) (int32, sets.Int32)

GetMaxReplicaCountAndDeleteSlots returns the max replica count and delete slots. The desired slots of this stateful set will be [0, replicaCount) - [delete slots].

func GetMinPodOrdinal

func GetMinPodOrdinal(replicas int32, set metav1.Object) int32

func GetPodOrdinals

func GetPodOrdinals(replicas int32, set metav1.Object) sets.Int32

func GetPodOrdinalsFromReplicasAndDeleteSlots

func GetPodOrdinalsFromReplicasAndDeleteSlots(replicas int32, deleteSlots sets.Int32) sets.Int32

func NewHijackClient

func NewHijackClient(client clientset.Interface, pcclient asclientset.Interface) clientset.Interface

NewHijackClient creates a new hijacked Kubernetes interface.

func SetDeleteSlots

func SetDeleteSlots(set metav1.Object, deleteSlots sets.Int32) (err error)

func ToBuiltinStatefulSet

func ToBuiltinStatefulSet(sts *asv1.StatefulSet) (*appsv1.StatefulSet, error)

func ToBuiltinStetefulsetList

func ToBuiltinStetefulsetList(stsList *asv1.StatefulSetList) (*appsv1.StatefulSetList, error)

func Upgrade

Upgrade upgrades Kubernetes builtin StatefulSet to Advanced StatefulSet.

This method is idempotent. The last operation is deleting the builtin StatefulSet, the caller must retry until the builtin StatefulSet is deleted succesfully.

Basic procedure:

- remove sts selector lebels from controller revisions and set a special annotation for Advanced StatefulSet (can be skipped if Kubernetes cluster has http://issues.k8s.io/84982 fixed) - create advanced sts - delete sts with DeletePropagationOrphan policy

Types

This section is empty.

Jump to

Keyboard shortcuts

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