member

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2018 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LastAppliedConfigAnnotation is annotation key of last applied configuration
	LastAppliedConfigAnnotation = "pingcap.com/last-applied-configuration"
)

Variables

This section is empty.

Functions

func EqualService

func EqualService(new, old *corev1.Service) (bool, error)

EqualService compare the new Service's spec with old Service's last applied config

func EqualStatefulSet

func EqualStatefulSet(new apps.StatefulSet, old apps.StatefulSet) (bool, error)

EqualStatefulSet compare the new Statefulset's spec with old Statefulset's last applied config

func EqualTemplate

func EqualTemplate(new corev1.PodTemplateSpec, old corev1.PodTemplateSpec) (bool, error)

EqualTemplate compare the new podTemplateSpec's spec with old podTemplateSpec's last applied config

func GetLastAppliedConfig

func GetLastAppliedConfig(set *apps.StatefulSet) (*apps.StatefulSetSpec, *corev1.PodSpec, error)

GetLastAppliedConfig get last applied config info from Statefulset's annotation

func NewPDMemberManager

NewPDMemberManager returns a *pdMemberManager

func NewTiDBMemberManager

NewTiDBMemberManager returns a *tidbMemberManager

func NewTiKVMemberManager

NewTiKVMemberManager returns a *tikvMemberManager

func SetLastAppliedConfigAnnotation

func SetLastAppliedConfigAnnotation(set *apps.StatefulSet) error

SetLastAppliedConfigAnnotation set last applied config info to Statefulset's annotation

func SetServiceLastAppliedConfigAnnotation

func SetServiceLastAppliedConfigAnnotation(svc *corev1.Service) error

SetServiceLastAppliedConfigAnnotation set last applied config info to Service's annotation

Types

type Scaler

type Scaler interface {
	// ScaleOut scales out the cluster
	ScaleOut(*v1alpha1.TidbCluster, *apps.StatefulSet, *apps.StatefulSet) error
	// ScaleIn scales in the cluster
	ScaleIn(*v1alpha1.TidbCluster, *apps.StatefulSet, *apps.StatefulSet) error
}

Scaler implements the logic for scaling out or scaling in the cluster.

func NewFakePDScaler

func NewFakePDScaler() Scaler

NewFakePDScaler returns a fake Scaler

func NewFakeTiKVScaler

func NewFakeTiKVScaler() Scaler

NewFakeTiKVScaler returns a fake tikv Scaler

func NewPDScaler

NewPDScaler returns a Scaler

func NewTiKVScaler

NewTiKVScaler returns a tikv Scaler

type SvcConfig

type SvcConfig struct {
	Name       string
	Port       int32
	SvcLabel   func(label.Label) label.Label
	MemberName func(clusterName string) string
	Headless   bool
}

SvcConfig corresponds to a K8s service

Jump to

Keyboard shortcuts

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