Documentation ¶
Index ¶
- Constants
- Variables
- func CreateOrUpdateService(serviceLister corelisters.ServiceLister, ...) error
- func DMMasterPodName(dcName string, ordinal int32) string
- func GetLastAppliedConfig(set *apps.StatefulSet) (*apps.StatefulSetSpec, *corev1.PodSpec, error)
- func GetPVCSelectorForPod(controller runtime.Object, memberType v1alpha1.MemberType, ordinal int32) (labels.Selector, error)
- func GetTiFlashConfig(tc *v1alpha1.TidbCluster) *v1alpha1.TiFlashConfigWraper
- func MapContainers(podSpec *corev1.PodSpec) map[string]corev1.Container
- func MapInitContainers(podSpec *corev1.PodSpec) map[string]corev1.Container
- func MarshalTOML(v interface{}) ([]byte, error)
- func MemberPodName(controllerName, controllerKind string, ordinal int32, ...) (string, error)
- func NeedForceUpgrade(ann map[string]string) bool
- func NewMasterMemberManager(deps *controller.Dependencies, masterScaler Scaler, masterUpgrader DMUpgrader, ...) manager.DMManager
- func NewPDMemberManager(dependencies *controller.Dependencies, pdScaler Scaler, pdUpgrader Upgrader, ...) manager.Manager
- func NewPumpMemberManager(deps *controller.Dependencies, scaler Scaler) manager.Manager
- func NewPumpScaler(deps *controller.Dependencies) *pumpScaler
- func NewTiCDCMemberManager(deps *controller.Dependencies, scaler Scaler, ticdcUpgrader Upgrader) manager.Manager
- func NewTiCDCScaler(deps *controller.Dependencies) *ticdcScaler
- func NewTiDBMemberManager(deps *controller.Dependencies, scaler Scaler, tidbUpgrader Upgrader, ...) manager.Manager
- func NewTiDBScaler(deps *controller.Dependencies) *tidbScaler
- func NewTiFlashMemberManager(deps *controller.Dependencies, tiflashFailover Failover, tiflashScaler Scaler, ...) manager.Manager
- func NewTiKVMemberManager(deps *controller.Dependencies, failover Failover, scaler Scaler, ...) manager.Manager
- func NewTiKVScaler(deps *controller.Dependencies) *tikvScaler
- func NewWorkerMemberManager(deps *controller.Dependencies, scaler Scaler, failover DMFailover) manager.DMManager
- func PdName(tcName string, ordinal int32, namespace string, clusterDomain string) string
- func PdPodName(tcName string, ordinal int32) string
- func RenderDMMasterStartScript(model *DMMasterStartScriptModel) (string, error)
- func RenderDMWorkerStartScript(model *DMWorkerStartScriptModel) (string, error)
- 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 TiFlashPodName(tcName string, ordinal int32) string
- func TiKVLessThanV50(image string) bool
- func TiKVStoreIDFromStatus(tc *v1alpha1.TidbCluster, podName string) (uint64, error)
- func TikvPodName(tcName string, ordinal int32) string
- func UnmarshalTOML(b []byte, obj interface{}) error
- type CommonModel
- type DMFailover
- type DMMasterStartScriptModel
- type DMUpgrader
- type DMWorkerStartScriptModel
- type Failover
- func NewFakePDFailover() Failover
- func NewFakeTiDBFailover() Failover
- func NewFakeTiFlashFailover() Failover
- func NewFakeTiKVFailover() Failover
- func NewPDFailover(deps *controller.Dependencies) Failover
- func NewTiDBFailover(deps *controller.Dependencies) Failover
- func NewTiFlashFailover(deps *controller.Dependencies) Failover
- func NewTiKVFailover(deps *controller.Dependencies) Failover
- type FakeDiscoveryManager
- type FakeMasterMemberManager
- type FakeOrphanPodsCleaner
- type FakePDMemberManager
- type FakePVCCleaner
- type FakePumpMemberManager
- type FakeTiCDCMemberManager
- type FakeTiDBInitManager
- type FakeTiDBMemberManager
- type FakeTiFlashMemberManager
- type FakeTiKVMemberManager
- type FakeTidbClusterStatusManager
- type FakeWorkerMemberManager
- type InitManager
- type OrphanPodsCleaner
- type PDStartScriptModel
- type PVCCleanerInterface
- type PVCResizerInterface
- type PumpStartScriptModel
- type Scaler
- func NewFakeMasterScaler() Scaler
- func NewFakePDScaler() Scaler
- func NewFakePumpScaler() Scaler
- func NewFakeTiFlashScaler() Scaler
- func NewFakeTiKVScaler() Scaler
- func NewFakeWorkerScaler() Scaler
- func NewMasterScaler(deps *controller.Dependencies) Scaler
- func NewPDScaler(deps *controller.Dependencies) Scaler
- func NewTiFlashScaler(deps *controller.Dependencies) Scaler
- func NewWorkerScaler(deps *controller.Dependencies) Scaler
- type SvcConfig
- type TiDBInitInitStartScriptModel
- type TiDBInitStartScriptModel
- type TiKVStartScriptModel
- type TiKVUpgrader
- type TidbClusterStatusManager
- type TidbDiscoveryManager
- type TidbStartScriptModel
- type Upgrader
- func NewFakePDUpgrader() Upgrader
- func NewFakeTiDBUpgrader() Upgrader
- func NewFakeTiFlashUpgrader() Upgrader
- func NewPDUpgrader(deps *controller.Dependencies) Upgrader
- func NewTiCDCUpgrader(deps *controller.Dependencies) Upgrader
- func NewTiDBUpgrader(deps *controller.Dependencies) Upgrader
- func NewTiFlashUpgrader(deps *controller.Dependencies) Upgrader
Constants ¶
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 (
// DefaultStorageSize is the default pvc request storage size for dm
DefaultStorageSize = "10Gi"
)
const (
// EvictLeaderBeginTime is the key of evict Leader begin time
EvictLeaderBeginTime = "evictLeaderBeginTime"
)
const (
FailedSetStoreLabels = "FailedSetStoreLabels"
)
TODO: move this to a centralized place Since the "Unhealthy" is a very universal event reason string, which could apply to all the TiDB/DM cluster components, we should make a global event module, and put event related constants there.
const (
PdTlsCertPath = "/var/lib/pd-tls"
)
Variables ¶
var ErrNotFoundStoreID = fmt.Errorf("not found")
Functions ¶
func CreateOrUpdateService ¶ added in v1.2.0
func CreateOrUpdateService(serviceLister corelisters.ServiceLister, serviceControl controller.ServiceControlInterface, newSvc *corev1.Service, obj runtime.Object) error
func DMMasterPodName ¶ added in v1.2.0
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 GetPVCSelectorForPod ¶ added in v1.1.13
func GetPVCSelectorForPod(controller runtime.Object, memberType v1alpha1.MemberType, ordinal int32) (labels.Selector, error)
GetPVCSelectorForPod compose a PVC selector from a tc/dm-cluster member pod at ordinal position
func GetTiFlashConfig ¶ added in v1.3.0
func GetTiFlashConfig(tc *v1alpha1.TidbCluster) *v1alpha1.TiFlashConfigWraper
func MapContainers ¶ added in v1.1.0
MapContainers index containers of Pod by container name in favor of looking up
func MapInitContainers ¶ added in v1.2.5
MapInitContainers index init 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 NeedForceUpgrade ¶ added in v1.1.0
NeedForceUpgrade check if force upgrade is necessary
func NewMasterMemberManager ¶ added in v1.2.0
func NewMasterMemberManager(deps *controller.Dependencies, masterScaler Scaler, masterUpgrader DMUpgrader, masterFailover DMFailover) manager.DMManager
NewMasterMemberManager returns a *masterMemberManager
func NewPDMemberManager ¶
func NewPDMemberManager(dependencies *controller.Dependencies, pdScaler Scaler, pdUpgrader Upgrader, pdFailover Failover) manager.Manager
NewPDMemberManager returns a *pdMemberManager
func NewPumpMemberManager ¶ added in v1.1.0
func NewPumpMemberManager(deps *controller.Dependencies, scaler Scaler) manager.Manager
NewPumpMemberManager returns a controller to reconcile pump clusters
func NewPumpScaler ¶ added in v1.2.0
func NewPumpScaler(deps *controller.Dependencies) *pumpScaler
NewPumpScaler returns a pump Scaler
func NewTiCDCMemberManager ¶ added in v1.1.0
func NewTiCDCMemberManager(deps *controller.Dependencies, scaler Scaler, ticdcUpgrader Upgrader) manager.Manager
NewTiCDCMemberManager returns a *ticdcMemberManager
func NewTiCDCScaler ¶ added in v1.2.0
func NewTiCDCScaler(deps *controller.Dependencies) *ticdcScaler
NewTiCDCScaler returns a TiCDC Scaler.
func NewTiDBMemberManager ¶
func NewTiDBMemberManager(deps *controller.Dependencies, scaler Scaler, tidbUpgrader Upgrader, tidbFailover Failover) manager.Manager
NewTiDBMemberManager returns a *tidbMemberManager
func NewTiDBScaler ¶ added in v1.1.13
func NewTiDBScaler(deps *controller.Dependencies) *tidbScaler
NewTiDBScaler returns a TiDB Scaler.
func NewTiFlashMemberManager ¶ added in v1.1.0
func NewTiFlashMemberManager(deps *controller.Dependencies, tiflashFailover Failover, tiflashScaler Scaler, tiflashUpgrader Upgrader) manager.Manager
NewTiFlashMemberManager returns a *tiflashMemberManager
func NewTiKVMemberManager ¶
func NewTiKVMemberManager(deps *controller.Dependencies, failover Failover, scaler Scaler, upgrader TiKVUpgrader) manager.Manager
NewTiKVMemberManager returns a *tikvMemberManager
func NewTiKVScaler ¶
func NewTiKVScaler(deps *controller.Dependencies) *tikvScaler
NewTiKVScaler returns a tikv Scaler
func NewWorkerMemberManager ¶ added in v1.2.0
func NewWorkerMemberManager(deps *controller.Dependencies, scaler Scaler, failover DMFailover) manager.DMManager
NewWorkerMemberManager returns a *ticdcMemberManager
func RenderDMMasterStartScript ¶ added in v1.2.0
func RenderDMMasterStartScript(model *DMMasterStartScriptModel) (string, error)
func RenderDMWorkerStartScript ¶ added in v1.2.0
func RenderDMWorkerStartScript(model *DMWorkerStartScriptModel) (string, error)
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 TiFlashPodName ¶ added in v1.1.11
func TiKVLessThanV50 ¶ added in v1.3.0
TiKVLessThanV50 checks whether the `image` is less than v5.0.0
func TiKVStoreIDFromStatus ¶ added in v1.3.0
func TiKVStoreIDFromStatus(tc *v1alpha1.TidbCluster, podName string) (uint64, error)
func TikvPodName ¶ added in v1.1.0
func UnmarshalTOML ¶ added in v1.1.0
Types ¶
type CommonModel ¶ added in v1.3.0
type CommonModel struct { AcrossK8s bool // same as tc.spec.acrossK8s ClusterDomain string // same as tc.spec.clusterDomain }
func (CommonModel) FormatClusterDomain ¶ added in v1.3.0
func (c CommonModel) FormatClusterDomain() string
type DMFailover ¶ added in v1.2.0
type DMFailover interface { Failover(*v1alpha1.DMCluster) error Recover(*v1alpha1.DMCluster) RemoveUndesiredFailures(*v1alpha1.DMCluster) }
DMFailover implements the logic for dm-master/dm-worker's failover and recovery.
func NewFakeMasterFailover ¶ added in v1.2.0
func NewFakeMasterFailover() DMFailover
NewFakeMasterFailover returns a fake Failover
func NewFakeWorkerFailover ¶ added in v1.2.0
func NewFakeWorkerFailover() DMFailover
NewFakeMasterFailover returns a fake Failover
func NewMasterFailover ¶ added in v1.2.0
func NewMasterFailover(deps *controller.Dependencies) DMFailover
NewMasterFailover returns a master Failover
func NewWorkerFailover ¶ added in v1.2.0
func NewWorkerFailover(deps *controller.Dependencies) DMFailover
NewWorkerFailover returns a worker Failover
type DMMasterStartScriptModel ¶ added in v1.2.0
type DMUpgrader ¶ added in v1.2.0
type DMUpgrader interface {
Upgrade(*v1alpha1.DMCluster, *apps.StatefulSet, *apps.StatefulSet) error
}
Upgrader implements the logic for upgrading the dm cluster.
func NewFakeMasterUpgrader ¶ added in v1.2.0
func NewFakeMasterUpgrader() DMUpgrader
NewFakeMasterUpgrader returns a fakeMasterUpgrader
func NewMasterUpgrader ¶ added in v1.2.0
func NewMasterUpgrader(deps *controller.Dependencies) DMUpgrader
NewMasterUpgrader returns a masterUpgrader
type DMWorkerStartScriptModel ¶ added in v1.2.0
type Failover ¶ added in v0.2.0
type Failover interface { Failover(*v1alpha1.TidbCluster) error Recover(*v1alpha1.TidbCluster) RemoveUndesiredFailures(*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(deps *controller.Dependencies) Failover
NewPDFailover returns a pd Failover
func NewTiDBFailover ¶ added in v0.2.0
func NewTiDBFailover(deps *controller.Dependencies) Failover
NewTiDBFailover returns a tidbFailover instance
func NewTiFlashFailover ¶ added in v1.1.0
func NewTiFlashFailover(deps *controller.Dependencies) Failover
NewTiFlashFailover returns a tiflash Failover
func NewTiKVFailover ¶ added in v0.2.0
func NewTiKVFailover(deps *controller.Dependencies) 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 (m *FakeDiscoveryManager) Reconcile(_ client.Object) error
func (*FakeDiscoveryManager) SetReconcileError ¶ added in v1.1.0
func (m *FakeDiscoveryManager) SetReconcileError(err error)
type FakeMasterMemberManager ¶ added in v1.2.0
type FakeMasterMemberManager struct {
// contains filtered or unexported fields
}
TODO: seems not used
func NewFakeMasterMemberManager ¶ added in v1.2.0
func NewFakeMasterMemberManager() *FakeMasterMemberManager
func (*FakeMasterMemberManager) SetSyncError ¶ added in v1.2.0
func (m *FakeMasterMemberManager) SetSyncError(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) SetnOrphanPodCleanerError ¶ added in v1.1.0
func (c *FakeOrphanPodsCleaner) SetnOrphanPodCleanerError(err error)
type FakePDMemberManager ¶ added in v0.4.0
type FakePDMemberManager struct {
// contains filtered or unexported fields
}
TODO: seems not used
func NewFakePDMemberManager ¶ added in v0.4.0
func NewFakePDMemberManager() *FakePDMemberManager
func (*FakePDMemberManager) SetSyncError ¶ added in v0.4.0
func (m *FakePDMemberManager) SetSyncError(err error)
func (*FakePDMemberManager) Sync ¶ added in v0.4.0
func (m *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) SetPVCCleanerError ¶ added in v1.1.0
func (c *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 (m *FakePumpMemberManager) SetSyncError(err error)
func (*FakePumpMemberManager) Sync ¶ added in v1.1.0
func (m *FakePumpMemberManager) Sync(*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 (m *FakeTiCDCMemberManager) SetSyncError(err error)
func (*FakeTiCDCMemberManager) Sync ¶ added in v1.1.0
func (m *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 (m *FakeTiDBMemberManager) SetSyncError(err error)
func (*FakeTiDBMemberManager) Sync ¶ added in v0.4.0
func (m *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 (m *FakeTiFlashMemberManager) SetSyncError(err error)
func (*FakeTiFlashMemberManager) Sync ¶ added in v1.1.0
func (m *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 (m *FakeTiKVMemberManager) SetSyncError(err error)
func (*FakeTiKVMemberManager) Sync ¶ added in v0.4.0
func (m *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 FakeWorkerMemberManager ¶ added in v1.2.0
type FakeWorkerMemberManager struct {
// contains filtered or unexported fields
}
func NewFakeWorkerMemberManager ¶ added in v1.2.0
func NewFakeWorkerMemberManager() *FakeWorkerMemberManager
func (*FakeWorkerMemberManager) SetSyncError ¶ added in v1.2.0
func (m *FakeWorkerMemberManager) SetSyncError(err 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(deps *controller.Dependencies) InitManager
NewTiDBInitManager return tidbInitManager
type OrphanPodsCleaner ¶ added in v1.0.0
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(deps *controller.Dependencies) OrphanPodsCleaner
NewOrphanPodsCleaner returns a OrphanPodsCleaner
type PDStartScriptModel ¶ added in v1.1.0
type PDStartScriptModel struct { CommonModel Scheme string DataDir string CheckDomainScript string }
type PVCCleanerInterface ¶ added in v1.0.1
PVCCleaner implements the logic for cleaning the pvc related resource
func NewRealPVCCleaner ¶ added in v1.0.1
func NewRealPVCCleaner(deps *controller.Dependencies) PVCCleanerInterface
NewRealPVCCleaner returns a realPVCCleaner
type PVCResizerInterface ¶ added in v1.1.4
type PVCResizerInterface interface { Sync(*v1alpha1.TidbCluster) error SyncDM(*v1alpha1.DMCluster) 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(deps *controller.Dependencies) PVCResizerInterface
type PumpStartScriptModel ¶ added in v1.1.0
type PumpStartScriptModel struct { CommonModel Scheme string ClusterName string PDAddr string LogLevel string Namespace string }
func (*PumpStartScriptModel) FormatPumpZone ¶ added in v1.2.0
func (pssm *PumpStartScriptModel) FormatPumpZone() string
type Scaler ¶
type Scaler interface { // Scale scales the cluster. It does nothing if scaling is not needed. Scale(meta metav1.Object, actual *apps.StatefulSet, desired *apps.StatefulSet) error // ScaleOut scales out the cluster ScaleOut(meta metav1.Object, actual *apps.StatefulSet, desired *apps.StatefulSet) error // ScaleIn scales in the cluster ScaleIn(meta metav1.Object, actual *apps.StatefulSet, desired *apps.StatefulSet) error }
Scaler implements the logic for scaling out or scaling in the cluster.
func NewFakeMasterScaler ¶ added in v1.2.0
func NewFakeMasterScaler() Scaler
NewFakeMasterScaler returns a fake Scaler
func NewFakePumpScaler ¶ added in v1.2.0
func NewFakePumpScaler() Scaler
NewFakePumpScaler returns a fake pump Scaler
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 NewFakeWorkerScaler ¶ added in v1.2.0
func NewFakeWorkerScaler() Scaler
NewFakeWorkerScaler returns a fake Scaler
func NewMasterScaler ¶ added in v1.2.0
func NewMasterScaler(deps *controller.Dependencies) Scaler
NewMasterScaler returns a DMScaler
func NewPDScaler ¶
func NewPDScaler(deps *controller.Dependencies) Scaler
NewPDScaler returns a Scaler
func NewTiFlashScaler ¶ added in v1.1.0
func NewTiFlashScaler(deps *controller.Dependencies) Scaler
NewTiFlashScaler returns a tiflash Scaler
func NewWorkerScaler ¶ added in v1.2.0
func NewWorkerScaler(deps *controller.Dependencies) Scaler
NewWorkerScaler returns a DMScaler
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 TiDBInitStartScriptModel ¶ added in v1.1.0
type TiKVStartScriptModel ¶ added in v1.1.0
type TiKVStartScriptModel struct { CommonModel EnableAdvertiseStatusAddr bool AdvertiseStatusAddr string DataDir string PDAddress string }
type TiKVUpgrader ¶ added in v1.2.0
type TiKVUpgrader interface {
Upgrade(meta metav1.Object, oldSet *apps.StatefulSet, newSet *apps.StatefulSet) error
}
func NewFakeTiKVUpgrader ¶ added in v0.2.0
func NewFakeTiKVUpgrader() TiKVUpgrader
NewFakeTiKVUpgrader returns a fake tikv upgrader
func NewTiKVUpgrader ¶ added in v0.2.0
func NewTiKVUpgrader(deps *controller.Dependencies) TiKVUpgrader
NewTiKVUpgrader returns a tikv Upgrader
type TidbClusterStatusManager ¶ added in v1.1.0
type TidbClusterStatusManager struct {
// contains filtered or unexported fields
}
func NewTidbClusterStatusManager ¶ added in v1.1.0
func NewTidbClusterStatusManager(deps *controller.Dependencies) *TidbClusterStatusManager
func (*TidbClusterStatusManager) Sync ¶ added in v1.1.0
func (m *TidbClusterStatusManager) Sync(tc *v1alpha1.TidbCluster) error
type TidbDiscoveryManager ¶ added in v1.1.0
func NewTidbDiscoveryManager ¶ added in v1.1.0
func NewTidbDiscoveryManager(deps *controller.Dependencies) TidbDiscoveryManager
type TidbStartScriptModel ¶ added in v1.1.0
type TidbStartScriptModel struct { CommonModel EnablePlugin bool PluginDirectory string PluginList string Path string }
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 NewPDUpgrader ¶ added in v0.2.0
func NewPDUpgrader(deps *controller.Dependencies) Upgrader
NewPDUpgrader returns a pdUpgrader
func NewTiCDCUpgrader ¶ added in v1.1.12
func NewTiCDCUpgrader(deps *controller.Dependencies) Upgrader
NewTiCDCUpgrader returns a ticdc Upgrader
func NewTiDBUpgrader ¶ added in v0.2.0
func NewTiDBUpgrader(deps *controller.Dependencies) Upgrader
NewTiDBUpgrader returns a tidb Upgrader
func NewTiFlashUpgrader ¶ added in v1.1.0
func NewTiFlashUpgrader(deps *controller.Dependencies) Upgrader
NewTiFlashUpgrader returns a tiflash Upgrader
Source Files ¶
- dm_master_failover.go
- dm_master_member_manager.go
- dm_master_scaler.go
- dm_master_upgrader.go
- dm_worker_failover.go
- dm_worker_member_manager.go
- dm_worker_scaler.go
- failover.go
- node.go
- orphan_pods_cleaner.go
- pd_failover.go
- pd_member_manager.go
- pd_scaler.go
- pd_upgrader.go
- pump_member_manager.go
- pump_scaler.go
- pvc_cleaner.go
- pvc_resizer.go
- scaler.go
- template.go
- ticdc_member_manager.go
- ticdc_scaler.go
- ticdc_upgrader.go
- tidb_discovery_manager.go
- tidb_failover.go
- tidb_init_manager.go
- tidb_member_manager.go
- tidb_scaler.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