Documentation ¶
Index ¶
- Constants
- func AddDeleteSlots(set metav1.Object, deleteSlots sets.Int32) (err error)
- func FromBuiltinStatefulSet(sts *appsv1.StatefulSet) (*asv1.StatefulSet, error)
- func GetDeleteSlots(set metav1.Object) (deleteSlots sets.Int32)
- func GetMaxPodOrdinal(replicas int32, set metav1.Object) int32
- func GetMaxReplicaCountAndDeleteSlots(replicas int32, deleteSlots sets.Int32) (int32, sets.Int32)
- func GetMinPodOrdinal(replicas int32, set metav1.Object) int32
- func GetPodOrdinals(replicas int32, set metav1.Object) sets.Int32
- func GetPodOrdinalsFromReplicasAndDeleteSlots(replicas int32, deleteSlots sets.Int32) sets.Int32
- func NewHijackClient(client clientset.Interface, pcclient asclientset.Interface) clientset.Interface
- func SetDeleteSlots(set metav1.Object, deleteSlots sets.Int32) (err error)
- func ToBuiltinStatefulSet(sts *asv1.StatefulSet) (*appsv1.StatefulSet, error)
- func ToBuiltinStetefulsetList(stsList *asv1.StatefulSetList) (*appsv1.StatefulSetList, error)
- func Upgrade(c clientset.Interface, asc asclientset.Interface, sts *appsv1.StatefulSet) (*asv1.StatefulSet, error)
Constants ¶
const (
DeleteSlotsAnn = "delete-slots"
)
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 FromBuiltinStatefulSet ¶
func FromBuiltinStatefulSet(sts *appsv1.StatefulSet) (*asv1.StatefulSet, error)
func GetMaxReplicaCountAndDeleteSlots ¶
GetMaxReplicaCountAndDeleteSlots returns the max replica count and delete slots. The desired slots of this stateful set will be [0, replicaCount) - [delete slots].
func NewHijackClient ¶
func NewHijackClient(client clientset.Interface, pcclient asclientset.Interface) clientset.Interface
NewHijackClient creates a new hijacked Kubernetes interface.
func ToBuiltinStatefulSet ¶
func ToBuiltinStatefulSet(sts *asv1.StatefulSet) (*appsv1.StatefulSet, error)
func ToBuiltinStetefulsetList ¶
func ToBuiltinStetefulsetList(stsList *asv1.StatefulSetList) (*appsv1.StatefulSetList, error)
func Upgrade ¶
func Upgrade(c clientset.Interface, asc asclientset.Interface, sts *appsv1.StatefulSet) (*asv1.StatefulSet, error)
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.