Documentation ¶
Index ¶
- Constants
- func AddConfigMapDigestSuffix(cm *corev1.ConfigMap) error
- func CombineAnnotations(a, b map[string]string) map[string]string
- func FindConfigMapVolume(podSpec *corev1.PodSpec, pred func(string) bool) string
- func GetLastAppliedConfig(set *apps.StatefulSet) (*apps.StatefulSetSpec, *corev1.PodSpec, error)
- func MapContainers(podSpec *corev1.PodSpec) map[string]corev1.Container
- func MarshalTOML(v interface{}) ([]byte, error)
- func MemberPodName(tcName string, ordinal int32, memberType v1alpha1.MemberType) string
- func NeedForceUpgrade(tc *v1alpha1.TidbCluster) bool
- func NewPDMemberManager(pdControl pdapi.PDControlInterface, ...) manager.Manager
- func NewPodRestarter(kubeCli kubernetes.Interface, podLister corelisters.PodLister) *podRestarter
- func NewPumpMemberManager(setControl controller.StatefulSetControlInterface, ...) manager.Manager
- func NewTiCDCMemberManager(pdControl pdapi.PDControlInterface, ...) manager.Manager
- func NewTiDBMemberManager(setControl controller.StatefulSetControlInterface, ...) manager.Manager
- func NewTiFlashMemberManager(pdControl pdapi.PDControlInterface, ...) manager.Manager
- func NewTiKVMemberManager(pdControl pdapi.PDControlInterface, ...) manager.Manager
- func PdPodName(tcName string, ordinal int32) string
- func RenderPDStartScript(model *PDStartScriptModel) (string, error)
- func RenderPumpStartScript(model *PumpStartScriptModel) (string, error)
- func RenderTiDBInitInitStartScript(model *TiDBInitInitStartScriptModel) (string, error)
- func RenderTiDBInitStartScript(model *TiDBInitStartScriptModel) (string, error)
- func RenderTiDBStartScript(model *TidbStartScriptModel) (string, error)
- func RenderTiKVStartScript(model *TiKVStartScriptModel) (string, error)
- func SetStatefulSetLastAppliedConfigAnnotation(set *apps.StatefulSet) error
- func Sha256Sum(v interface{}) (string, error)
- func TikvPodName(tcName string, ordinal int32) string
- func UnmarshalTOML(b []byte, obj interface{}) error
- type Failover
- func NewFakePDFailover() Failover
- func NewFakeTiDBFailover() Failover
- func NewFakeTiFlashFailover() Failover
- func NewFakeTiKVFailover() Failover
- func NewPDFailover(cli versioned.Interface, pdControl pdapi.PDControlInterface, ...) Failover
- func NewTiDBFailover(failoverPeriod time.Duration, recorder record.EventRecorder, ...) Failover
- func NewTiFlashFailover(tiflashFailoverPeriod time.Duration, recorder record.EventRecorder) Failover
- func NewTiKVFailover(tikvFailoverPeriod time.Duration, recorder record.EventRecorder) Failover
- type FakeDiscoveryManager
- type FakeOrphanPodsCleaner
- type FakePDMemberManager
- type FakePVCCleaner
- type FakePumpMemberManager
- type FakeRestarter
- type FakeTiCDCMemberManager
- type FakeTiDBInitManager
- type FakeTiDBMemberManager
- type FakeTiFlashMemberManager
- type FakeTiKVMemberManager
- type FakeTidbClusterStatusManager
- type InitManager
- type OrphanPodsCleaner
- type PDStartScriptModel
- type PVCCleanerInterface
- type PVCResizerInterface
- type PodRestarter
- type PumpStartScriptModel
- type Scaler
- type SvcConfig
- type TiDBInitInitStartScriptModel
- type TiDBInitStartScriptModel
- type TiKVStartScriptModel
- type TidbClusterStatusManager
- type TidbDiscoveryManager
- type TidbStartScriptModel
- type Upgrader
- func NewFakePDUpgrader() Upgrader
- func NewFakeTiDBUpgrader() Upgrader
- func NewFakeTiFlashUpgrader() Upgrader
- func NewFakeTiKVUpgrader() Upgrader
- func NewPDUpgrader(pdControl pdapi.PDControlInterface, podControl controller.PodControlInterface, ...) Upgrader
- func NewTiDBUpgrader(tidbControl controller.TiDBControlInterface, podLister corelisters.PodLister) Upgrader
- func NewTiFlashUpgrader(pdControl pdapi.PDControlInterface, podControl controller.PodControlInterface, ...) Upgrader
- func NewTiKVUpgrader(pdControl pdapi.PDControlInterface, podControl controller.PodControlInterface, ...) Upgrader
Constants ¶
const ( // EvictLeaderBeginTime is the key of evict Leader begin time EvictLeaderBeginTime = "evictLeaderBeginTime" // EvictLeaderTimeout is the timeout limit of evict leader EvictLeaderTimeout = 3 * time.Minute )
const ( // LastAppliedConfigAnnotation is annotation key of last applied configuration LastAppliedConfigAnnotation = "pingcap.com/last-applied-configuration" // ImagePullBackOff is the pod state of image pull failed ImagePullBackOff = "ImagePullBackOff" // ErrImagePull is the pod state of image pull failed ErrImagePull = "ErrImagePull" )
const (
FailedSetStoreLabels = "FailedSetStoreLabels"
)
const (
PdTlsCertPath = "/var/lib/pd-tls"
)
Variables ¶
This section is empty.
Functions ¶
func AddConfigMapDigestSuffix ¶ added in v1.1.0
func CombineAnnotations ¶ added in v1.0.0
CombineAnnotations merges two annotations maps
func FindConfigMapVolume ¶ added in v1.1.0
FindConfigMapVolume returns the configmap which's name matches the predicate in a PodSpec, empty indicates not found
func GetLastAppliedConfig ¶
func GetLastAppliedConfig(set *apps.StatefulSet) (*apps.StatefulSetSpec, *corev1.PodSpec, error)
GetLastAppliedConfig get last applied config info from Statefulset's annotation and the podTemplate's annotation
func MapContainers ¶ added in v1.1.0
MapContainers index containers of Pod by container name in favor of looking up
func MarshalTOML ¶ added in v1.1.0
MarshalTOML is a template function that try to marshal a go value to toml
func MemberPodName ¶ added in v1.1.0
func MemberPodName(tcName string, ordinal int32, memberType v1alpha1.MemberType) string
func NeedForceUpgrade ¶ added in v1.1.0
func NeedForceUpgrade(tc *v1alpha1.TidbCluster) bool
NeedForceUpgrade check if force upgrade is necessary
func NewPDMemberManager ¶
func NewPDMemberManager(pdControl pdapi.PDControlInterface, setControl controller.StatefulSetControlInterface, svcControl controller.ServiceControlInterface, podControl controller.PodControlInterface, typedControl controller.TypedControlInterface, setLister v1.StatefulSetLister, svcLister corelisters.ServiceLister, podLister corelisters.PodLister, epsLister corelisters.EndpointsLister, pvcLister corelisters.PersistentVolumeClaimLister, pdScaler Scaler, pdUpgrader Upgrader, autoFailover bool, pdFailover Failover) manager.Manager
NewPDMemberManager returns a *pdMemberManager
func NewPodRestarter ¶ added in v1.1.0
func NewPodRestarter(kubeCli kubernetes.Interface, podLister corelisters.PodLister) *podRestarter
func NewPumpMemberManager ¶ added in v1.1.0
func NewPumpMemberManager( setControl controller.StatefulSetControlInterface, svcControl controller.ServiceControlInterface, typedControl controller.TypedControlInterface, cmControl controller.ConfigMapControlInterface, setLister v1.StatefulSetLister, svcLister corelisters.ServiceLister, podLister corelisters.PodLister) manager.Manager
NewPumpMemberManager returns a controller to reconcile pump clusters
func NewTiCDCMemberManager ¶ added in v1.1.0
func NewTiCDCMemberManager( pdControl pdapi.PDControlInterface, cdcControl controller.TiCDCControlInterface, typedControl controller.TypedControlInterface, stsLister appslisters.StatefulSetLister, svcLister corelisters.ServiceLister, podLister corelisters.PodLister, svcControl controller.ServiceControlInterface, stsControl controller.StatefulSetControlInterface) manager.Manager
NewTiCDCMemberManager returns a *ticdcMemberManager
func NewTiDBMemberManager ¶
func NewTiDBMemberManager(setControl controller.StatefulSetControlInterface, svcControl controller.ServiceControlInterface, tidbControl controller.TiDBControlInterface, typedControl controller.TypedControlInterface, setLister v1.StatefulSetLister, svcLister corelisters.ServiceLister, podLister corelisters.PodLister, secretLister corelisters.SecretLister, tidbUpgrader Upgrader, autoFailover bool, tidbFailover Failover) manager.Manager
NewTiDBMemberManager returns a *tidbMemberManager
func NewTiFlashMemberManager ¶ added in v1.1.0
func NewTiFlashMemberManager( pdControl pdapi.PDControlInterface, setControl controller.StatefulSetControlInterface, svcControl controller.ServiceControlInterface, typedControl controller.TypedControlInterface, setLister v1.StatefulSetLister, svcLister corelisters.ServiceLister, podLister corelisters.PodLister, nodeLister corelisters.NodeLister, autoFailover bool, tiflashFailover Failover, tiflashScaler Scaler, tiflashUpgrader Upgrader) manager.Manager
NewTiFlashMemberManager returns a *tiflashMemberManager
func NewTiKVMemberManager ¶
func NewTiKVMemberManager( pdControl pdapi.PDControlInterface, setControl controller.StatefulSetControlInterface, svcControl controller.ServiceControlInterface, typedControl controller.TypedControlInterface, setLister v1.StatefulSetLister, svcLister corelisters.ServiceLister, podLister corelisters.PodLister, nodeLister corelisters.NodeLister, autoFailover bool, tikvFailover Failover, tikvScaler Scaler, tikvUpgrader Upgrader, recorder record.EventRecorder) manager.Manager
NewTiKVMemberManager returns a *tikvMemberManager
func RenderPDStartScript ¶ added in v1.1.0
func RenderPDStartScript(model *PDStartScriptModel) (string, error)
func RenderPumpStartScript ¶ added in v1.1.0
func RenderPumpStartScript(model *PumpStartScriptModel) (string, error)
func RenderTiDBInitInitStartScript ¶ added in v1.1.0
func RenderTiDBInitInitStartScript(model *TiDBInitInitStartScriptModel) (string, error)
func RenderTiDBInitStartScript ¶ added in v1.1.0
func RenderTiDBInitStartScript(model *TiDBInitStartScriptModel) (string, error)
func RenderTiDBStartScript ¶ added in v1.1.0
func RenderTiDBStartScript(model *TidbStartScriptModel) (string, error)
func RenderTiKVStartScript ¶ added in v1.1.0
func RenderTiKVStartScript(model *TiKVStartScriptModel) (string, error)
func SetStatefulSetLastAppliedConfigAnnotation ¶ added in v1.1.0
func SetStatefulSetLastAppliedConfigAnnotation(set *apps.StatefulSet) error
SetStatefulSetLastAppliedConfigAnnotation set last applied config to Statefulset's annotation
func TikvPodName ¶ added in v1.1.0
func UnmarshalTOML ¶ added in v1.1.0
Types ¶
type Failover ¶ added in v0.2.0
type Failover interface { Failover(*v1alpha1.TidbCluster) error Recover(*v1alpha1.TidbCluster) }
Failover implements the logic for pd/tikv/tidb's failover and recovery.
func NewFakePDFailover ¶ added in v0.2.0
func NewFakePDFailover() Failover
NewFakePDFailover returns a fake Failover
func NewFakeTiDBFailover ¶ added in v0.2.0
func NewFakeTiDBFailover() Failover
NewFakeTiDBFailover returns a fake Failover
func NewFakeTiFlashFailover ¶ added in v1.1.0
func NewFakeTiFlashFailover() Failover
NewFakeTiFlashFailover returns a fake Failover
func NewFakeTiKVFailover ¶ added in v0.2.0
func NewFakeTiKVFailover() Failover
NewFakeTiKVFailover returns a fake Failover
func NewPDFailover ¶ added in v0.2.0
func NewPDFailover(cli versioned.Interface, pdControl pdapi.PDControlInterface, pdFailoverPeriod time.Duration, podLister corelisters.PodLister, podControl controller.PodControlInterface, pvcLister corelisters.PersistentVolumeClaimLister, pvcControl controller.PVCControlInterface, pvLister corelisters.PersistentVolumeLister, recorder record.EventRecorder) Failover
NewPDFailover returns a pd Failover
func NewTiDBFailover ¶ added in v0.2.0
func NewTiDBFailover(failoverPeriod time.Duration, recorder record.EventRecorder, podLister corelisters.PodLister) Failover
NewTiDBFailover returns a tidbFailover instance
func NewTiFlashFailover ¶ added in v1.1.0
func NewTiFlashFailover(tiflashFailoverPeriod time.Duration, recorder record.EventRecorder) Failover
NewTiFlashFailover returns a tiflash Failover
func NewTiKVFailover ¶ added in v0.2.0
func NewTiKVFailover(tikvFailoverPeriod time.Duration, recorder record.EventRecorder) Failover
NewTiKVFailover returns a tikv Failover
type FakeDiscoveryManager ¶ added in v1.1.0
type FakeDiscoveryManager struct {
// contains filtered or unexported fields
}
func NewFakeDiscoveryManger ¶ added in v1.1.0
func NewFakeDiscoveryManger() *FakeDiscoveryManager
func (*FakeDiscoveryManager) Reconcile ¶ added in v1.1.0
func (fdm *FakeDiscoveryManager) Reconcile(_ *v1alpha1.TidbCluster) error
func (*FakeDiscoveryManager) SetReconcileError ¶ added in v1.1.0
func (fdm *FakeDiscoveryManager) SetReconcileError(err error)
type FakeOrphanPodsCleaner ¶ added in v1.1.0
type FakeOrphanPodsCleaner struct {
// contains filtered or unexported fields
}
func NewFakeOrphanPodsCleaner ¶ added in v1.0.0
func NewFakeOrphanPodsCleaner() *FakeOrphanPodsCleaner
NewFakeOrphanPodsCleaner returns a fake orphan pods cleaner
func (*FakeOrphanPodsCleaner) Clean ¶ added in v1.1.0
func (fpc *FakeOrphanPodsCleaner) Clean(_ *v1alpha1.TidbCluster) (map[string]string, error)
func (*FakeOrphanPodsCleaner) SetnOrphanPodCleanerError ¶ added in v1.1.0
func (fpc *FakeOrphanPodsCleaner) SetnOrphanPodCleanerError(err error)
type FakePDMemberManager ¶ added in v0.4.0
type FakePDMemberManager struct {
// contains filtered or unexported fields
}
func NewFakePDMemberManager ¶ added in v0.4.0
func NewFakePDMemberManager() *FakePDMemberManager
func (*FakePDMemberManager) SetSyncError ¶ added in v0.4.0
func (fpmm *FakePDMemberManager) SetSyncError(err error)
func (*FakePDMemberManager) Sync ¶ added in v0.4.0
func (fpmm *FakePDMemberManager) Sync(tc *v1alpha1.TidbCluster) error
type FakePVCCleaner ¶ added in v1.1.0
type FakePVCCleaner struct {
// contains filtered or unexported fields
}
func NewFakePVCCleaner ¶ added in v1.0.1
func NewFakePVCCleaner() *FakePVCCleaner
NewFakePVCCleaner returns a fake PVC cleaner
func (*FakePVCCleaner) Clean ¶ added in v1.1.0
func (fpc *FakePVCCleaner) Clean(_ *v1alpha1.TidbCluster) (map[string]string, error)
func (*FakePVCCleaner) SetPVCCleanerError ¶ added in v1.1.0
func (fpc *FakePVCCleaner) SetPVCCleanerError(err error)
type FakePumpMemberManager ¶ added in v1.1.0
type FakePumpMemberManager struct {
// contains filtered or unexported fields
}
func NewFakePumpMemberManager ¶ added in v1.1.0
func NewFakePumpMemberManager() *FakePumpMemberManager
func (*FakePumpMemberManager) SetSyncError ¶ added in v1.1.0
func (ftmm *FakePumpMemberManager) SetSyncError(err error)
func (*FakePumpMemberManager) Sync ¶ added in v1.1.0
func (ftmm *FakePumpMemberManager) Sync(tc *v1alpha1.TidbCluster) error
type FakeRestarter ¶ added in v1.1.0
type FakeRestarter struct { }
func NewFakePodRestarter ¶ added in v1.1.0
func NewFakePodRestarter() *FakeRestarter
func (*FakeRestarter) Sync ¶ added in v1.1.0
func (fsr *FakeRestarter) Sync(tc *v1alpha1.TidbCluster) error
type FakeTiCDCMemberManager ¶ added in v1.1.0
type FakeTiCDCMemberManager struct {
// contains filtered or unexported fields
}
func NewFakeTiCDCMemberManager ¶ added in v1.1.0
func NewFakeTiCDCMemberManager() *FakeTiCDCMemberManager
func (*FakeTiCDCMemberManager) SetSyncError ¶ added in v1.1.0
func (ftmm *FakeTiCDCMemberManager) SetSyncError(err error)
func (*FakeTiCDCMemberManager) Sync ¶ added in v1.1.0
func (ftmm *FakeTiCDCMemberManager) Sync(tc *v1alpha1.TidbCluster) error
type FakeTiDBInitManager ¶ added in v1.1.0
type FakeTiDBInitManager struct {
// contains filtered or unexported fields
}
FakeTiDBInitManager FakeTiDBInitManager
func NewFakeTiDBInitManager ¶ added in v1.1.0
func NewFakeTiDBInitManager() *FakeTiDBInitManager
NewFakeTiDBInitManager NewFakeTiDBInitManager
func (*FakeTiDBInitManager) SetSyncError ¶ added in v1.1.0
func (ftm *FakeTiDBInitManager) SetSyncError(err error)
SetSyncError SetSyncError
func (*FakeTiDBInitManager) Sync ¶ added in v1.1.0
func (ftm *FakeTiDBInitManager) Sync(_ *v1alpha1.TidbInitializer) error
Sync Sync
type FakeTiDBMemberManager ¶ added in v0.4.0
type FakeTiDBMemberManager struct {
// contains filtered or unexported fields
}
func NewFakeTiDBMemberManager ¶ added in v0.4.0
func NewFakeTiDBMemberManager() *FakeTiDBMemberManager
func (*FakeTiDBMemberManager) SetSyncError ¶ added in v0.4.0
func (ftmm *FakeTiDBMemberManager) SetSyncError(err error)
func (*FakeTiDBMemberManager) Sync ¶ added in v0.4.0
func (ftmm *FakeTiDBMemberManager) Sync(tc *v1alpha1.TidbCluster) error
type FakeTiFlashMemberManager ¶ added in v1.1.0
type FakeTiFlashMemberManager struct {
// contains filtered or unexported fields
}
func NewFakeTiFlashMemberManager ¶ added in v1.1.0
func NewFakeTiFlashMemberManager() *FakeTiFlashMemberManager
func (*FakeTiFlashMemberManager) SetSyncError ¶ added in v1.1.0
func (ftmm *FakeTiFlashMemberManager) SetSyncError(err error)
func (*FakeTiFlashMemberManager) Sync ¶ added in v1.1.0
func (ftmm *FakeTiFlashMemberManager) Sync(tc *v1alpha1.TidbCluster) error
type FakeTiKVMemberManager ¶ added in v0.4.0
type FakeTiKVMemberManager struct {
// contains filtered or unexported fields
}
func NewFakeTiKVMemberManager ¶ added in v0.4.0
func NewFakeTiKVMemberManager() *FakeTiKVMemberManager
func (*FakeTiKVMemberManager) SetSyncError ¶ added in v0.4.0
func (ftmm *FakeTiKVMemberManager) SetSyncError(err error)
func (*FakeTiKVMemberManager) Sync ¶ added in v0.4.0
func (ftmm *FakeTiKVMemberManager) Sync(tc *v1alpha1.TidbCluster) error
type FakeTidbClusterStatusManager ¶ added in v1.1.0
type FakeTidbClusterStatusManager struct { }
func NewFakeTidbClusterStatusManager ¶ added in v1.1.0
func NewFakeTidbClusterStatusManager() *FakeTidbClusterStatusManager
func (*FakeTidbClusterStatusManager) Sync ¶ added in v1.1.0
func (f *FakeTidbClusterStatusManager) Sync(tc *v1alpha1.TidbCluster) error
type InitManager ¶ added in v1.1.0
type InitManager interface { // Sync implements the logic for syncing TidbInitializer. Sync(*v1alpha1.TidbInitializer) error }
InitManager implements the logic for syncing TidbInitializer.
func NewTiDBInitManager ¶ added in v1.1.0
func NewTiDBInitManager( jobLister batchlisters.JobLister, genericCli client.Client, tiLister listers.TidbInitializerLister, tcLister listers.TidbClusterLister, typedControl controller.TypedControlInterface, ) InitManager
NewTiDBInitManager return tidbInitManager
type OrphanPodsCleaner ¶ added in v1.0.0
type OrphanPodsCleaner interface {
Clean(*v1alpha1.TidbCluster) (map[string]string, error)
}
OrphanPodsCleaner implements the logic for cleaning the orphan pods(has no pvc)
In scaling out and failover, we will try to delete the old PVC to prevent it from being used by the new pod. However, the PVC might not be deleted immediately in the apiserver because of finalizers (e.g. kubernetes.io/pvc-protection) and the statefulset controller may not have received PVC delete event when it tries to create the new replica and the new pod will be pending forever because no PVC to use. We need to clean these orphan pods and let the statefulset controller to create PVC(s) for them.
func NewOrphanPodsCleaner ¶ added in v1.0.0
func NewOrphanPodsCleaner(podLister corelisters.PodLister, podControl controller.PodControlInterface, pvcLister corelisters.PersistentVolumeClaimLister, kubeCli kubernetes.Interface) OrphanPodsCleaner
NewOrphanPodsCleaner returns a OrphanPodsCleaner
type PDStartScriptModel ¶ added in v1.1.0
type PVCCleanerInterface ¶ added in v1.0.1
type PVCCleanerInterface interface {
Clean(*v1alpha1.TidbCluster) (map[string]string, error)
}
PVCCleaner implements the logic for cleaning the pvc related resource
func NewRealPVCCleaner ¶ added in v1.0.1
func NewRealPVCCleaner( kubeCli kubernetes.Interface, podLister corelisters.PodLister, pvcControl controller.PVCControlInterface, pvcLister corelisters.PersistentVolumeClaimLister, pvLister corelisters.PersistentVolumeLister, pvControl controller.PVControlInterface) PVCCleanerInterface
NewRealPVCCleaner returns a realPVCCleaner
type PVCResizerInterface ¶ added in v1.1.4
type PVCResizerInterface interface {
Resize(*v1alpha1.TidbCluster) error
}
PVCResizerInterface represents the interface of PVC Resizer. It patches the PVCs owned by tidb cluster according to the latest storage request specified by the user. See https://github.com/pingcap/tidb-operator/issues/3004 for more details.
Implementation:
for every unmatched PVC (desiredCapacity != actualCapacity)
if storageClass does not support VolumeExpansion, skip and continue if not patched, patch
We patch all PVCs at the same time. For many cloud storage plugins (e.g. AWS-EBS, GCE-PD), they support online file system expansion in latest Kubernetes (1.15+).
Limitations:
- Note that the current statfulset implementation does not allow `volumeClaimTemplates` to be changed, so new PVCs created by statefulset controller will use the old storage request.
- This is best effort, before statefulset volume resize feature (e.g. https://github.com/kubernetes/enhancements/pull/1848) to be implemented.
- If the feature `ExpandInUsePersistentVolumes` is not enabled or the volume plugin does not support, the pod referencing the volume must be deleted and recreated after the `FileSystemResizePending` condition becomes true.
- Shrinking volumes is not supported.
func NewFakePVCResizer ¶ added in v1.1.4
func NewFakePVCResizer() PVCResizerInterface
func NewPVCResizer ¶ added in v1.1.4
func NewPVCResizer(kubeCli kubernetes.Interface, pvcInformer coreinformers.PersistentVolumeClaimInformer, storageClassInformer storageinformers.StorageClassInformer) PVCResizerInterface
type PodRestarter ¶ added in v1.1.0
type PodRestarter interface {
Sync(tc *v1alpha1.TidbCluster) error
}
type PumpStartScriptModel ¶ added in v1.1.0
type Scaler ¶
type Scaler interface { // Scale scales the cluster. It does nothing if scaling is not needed. Scale(tc *v1alpha1.TidbCluster, actual *apps.StatefulSet, desired *apps.StatefulSet) error // ScaleOut scales out the cluster ScaleOut(tc *v1alpha1.TidbCluster, actual *apps.StatefulSet, desired *apps.StatefulSet) error // ScaleIn scales in the cluster ScaleIn(tc *v1alpha1.TidbCluster, actual *apps.StatefulSet, desired *apps.StatefulSet) error // SyncAutoScalerAnn would sync Ann created by AutoScaler SyncAutoScalerAnn(tc *v1alpha1.TidbCluster, actual *apps.StatefulSet) error }
Scaler implements the logic for scaling out or scaling in the cluster.
func NewFakeTiFlashScaler ¶ added in v1.1.0
func NewFakeTiFlashScaler() Scaler
NewFakeTiFlashScaler returns a fake tiflash Scaler
func NewFakeTiKVScaler ¶
func NewFakeTiKVScaler() Scaler
NewFakeTiKVScaler returns a fake tikv Scaler
func NewPDScaler ¶
func NewPDScaler(pdControl pdapi.PDControlInterface, pvcLister corelisters.PersistentVolumeClaimLister, pvcControl controller.PVCControlInterface) Scaler
NewPDScaler returns a Scaler
func NewTiFlashScaler ¶ added in v1.1.0
func NewTiFlashScaler(pdControl pdapi.PDControlInterface, pvcLister corelisters.PersistentVolumeClaimLister, pvcControl controller.PVCControlInterface, podLister corelisters.PodLister) Scaler
NewTiFlashScaler returns a tiflash Scaler
func NewTiKVScaler ¶
func NewTiKVScaler(pdControl pdapi.PDControlInterface, pvcLister corelisters.PersistentVolumeClaimLister, pvcControl controller.PVCControlInterface, podLister corelisters.PodLister) Scaler
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
type TiDBInitInitStartScriptModel ¶ added in v1.1.0
type TiDBInitInitStartScriptModel struct {
ClusterName string
}
type TiDBInitStartScriptModel ¶ added in v1.1.0
type TiKVStartScriptModel ¶ added in v1.1.0
type TidbClusterStatusManager ¶ added in v1.1.0
type TidbClusterStatusManager struct {
// contains filtered or unexported fields
}
func NewTidbClusterStatusManager ¶ added in v1.1.0
func NewTidbClusterStatusManager(kubeCli kubernetes.Interface, cli versioned.Interface, scalerLister listers.TidbClusterAutoScalerLister) *TidbClusterStatusManager
func (*TidbClusterStatusManager) Sync ¶ added in v1.1.0
func (tcsm *TidbClusterStatusManager) Sync(tc *v1alpha1.TidbCluster) error
type TidbDiscoveryManager ¶ added in v1.1.0
type TidbDiscoveryManager interface {
Reconcile(tc *v1alpha1.TidbCluster) error
}
func NewTidbDiscoveryManager ¶ added in v1.1.0
func NewTidbDiscoveryManager(typedControl controller.TypedControlInterface) TidbDiscoveryManager
type TidbStartScriptModel ¶ added in v1.1.0
type Upgrader ¶ added in v0.2.0
type Upgrader interface { // Upgrade upgrade the cluster Upgrade(*v1alpha1.TidbCluster, *apps.StatefulSet, *apps.StatefulSet) error }
Upgrader implements the logic for upgrading the tidb cluster.
func NewFakePDUpgrader ¶ added in v0.2.0
func NewFakePDUpgrader() Upgrader
NewFakePDUpgrader returns a fakePDUpgrader
func NewFakeTiDBUpgrader ¶ added in v0.2.0
func NewFakeTiDBUpgrader() Upgrader
NewFakeTiDBUpgrader returns a fake tidb upgrader
func NewFakeTiFlashUpgrader ¶ added in v1.1.0
func NewFakeTiFlashUpgrader() Upgrader
NewFakeTiFlashUpgrader returns a fake tiflash upgrader
func NewFakeTiKVUpgrader ¶ added in v0.2.0
func NewFakeTiKVUpgrader() Upgrader
NewFakeTiKVUpgrader returns a fake tikv upgrader
func NewPDUpgrader ¶ added in v0.2.0
func NewPDUpgrader(pdControl pdapi.PDControlInterface, podControl controller.PodControlInterface, podLister corelisters.PodLister) Upgrader
NewPDUpgrader returns a pdUpgrader
func NewTiDBUpgrader ¶ added in v0.2.0
func NewTiDBUpgrader(tidbControl controller.TiDBControlInterface, podLister corelisters.PodLister) Upgrader
NewTiDBUpgrader returns a tidb Upgrader
func NewTiFlashUpgrader ¶ added in v1.1.0
func NewTiFlashUpgrader(pdControl pdapi.PDControlInterface, podControl controller.PodControlInterface, podLister corelisters.PodLister) Upgrader
NewTiFlashUpgrader returns a tiflash Upgrader
func NewTiKVUpgrader ¶ added in v0.2.0
func NewTiKVUpgrader(pdControl pdapi.PDControlInterface, podControl controller.PodControlInterface, podLister corelisters.PodLister) Upgrader
NewTiKVUpgrader returns a tikv Upgrader
Source Files ¶
- failover.go
- orphan_pods_cleaner.go
- pd_failover.go
- pd_member_manager.go
- pd_scaler.go
- pd_upgrader.go
- pod_restarter.go
- pump_member_manager.go
- pvc_cleaner.go
- pvc_resizer.go
- scaler.go
- template.go
- ticdc_member_manager.go
- tidb_discovery_manager.go
- tidb_failover.go
- tidb_init_manager.go
- tidb_member_manager.go
- tidb_upgrader.go
- tidbcluster_status_manager.go
- tiflash_failover.go
- tiflash_member_manager.go
- tiflash_scaler.go
- tiflash_upgrader.go
- tiflash_util.go
- tikv_failover.go
- tikv_member_manager.go
- tikv_scaler.go
- tikv_upgrader.go
- upgrader.go
- utils.go