Documentation ¶
Index ¶
- Constants
- func DeepCopyClientObject(input client.Object) client.Object
- func GetLastAppliedConfig(set *apps.StatefulSet) (*apps.StatefulSetSpec, *corev1.PodSpec, error)
- func NeedForceUpgrade(ann map[string]string) bool
- func NewExecutorMemberManager(cli client.Client, clientSet kubernetes.Interface) manager.TiflowManager
- func NewMasterMemberManager(cli client.Client, clientSet kubernetes.Interface) manager.TiflowManager
- func RenderExecutorStartScript(model *TiflowExecutorStartScriptModel) (string, error)
- func RenderTiflowMasterStartScript(model *TiflowMasterStartScriptModel) (string, error)
- func TiflowExecutorPodName(tcName string, ordinal int32) string
- func TiflowMasterPeerSvcName(tcName string, ordinal int32) string
- func TiflowMasterPodName(tcName string, ordinal int32) string
- type CommonModel
- type Failover
- type MergeFn
- type Scaler
- type TiflowExecutorStartScriptModel
- type TiflowMasterStartScriptModel
- type Upgrader
Constants ¶
const ( // DefaultStorageSize is the default pvc request storage size for dm DefaultStorageSize = "10Gi" // DefaultStorageName is the default pvc name DefaultStorageName = "dataflow" )
const (
FailedSetStoreLabels = "FailedSetStoreLabels"
)
Since the "Unhealthy" is a very universal event reason string, which could apply to all the tiflow cluster components, we should make a global event module, and put event related constants there.
const (
LastAppliedConfigAnnotation = "pingcap.com/last-applied-configuration"
)
Variables ¶
This section is empty.
Functions ¶
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 NeedForceUpgrade ¶
NeedForceUpgrade check if force upgrade is necessary
func NewExecutorMemberManager ¶
func NewExecutorMemberManager(cli client.Client, clientSet kubernetes.Interface) manager.TiflowManager
func NewMasterMemberManager ¶
func NewMasterMemberManager(cli client.Client, clientSet kubernetes.Interface) manager.TiflowManager
func RenderExecutorStartScript ¶
func RenderExecutorStartScript(model *TiflowExecutorStartScriptModel) (string, error)
func RenderTiflowMasterStartScript ¶
func RenderTiflowMasterStartScript(model *TiflowMasterStartScriptModel) (string, error)
func TiflowExecutorPodName ¶
func TiflowMasterPeerSvcName ¶
func TiflowMasterPodName ¶
Types ¶
type CommonModel ¶
type CommonModel struct {
ClusterDomain string // same as tc.spec.clusterDomain
}
func (CommonModel) FormatClusterDomain ¶
func (c CommonModel) FormatClusterDomain() string
type Failover ¶
type Failover interface { Failover(cluster *v1alpha1.TiflowCluster) error Recover(cluster *v1alpha1.TiflowCluster) RemoveUndesiredFailures(cluster *v1alpha1.TiflowCluster) }
Failover implements the logic for tiflow cluster failover and recovery.
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 NewExecutorScaler ¶
func NewExecutorScaler(clientSet kubernetes.Interface) Scaler
NewExecutorScaler return a executorScaler
func NewMasterScaler ¶
func NewMasterScaler(cli client.Client, clientSet kubernetes.Interface) Scaler
NewMasterScaler returns a DMScaler
type TiflowExecutorStartScriptModel ¶
type TiflowExecutorStartScriptModel struct { CommonModel DataDir string MasterAddress string }
type TiflowMasterStartScriptModel ¶
type TiflowMasterStartScriptModel struct { CommonModel Scheme string }
type Upgrader ¶
type Upgrader interface { // Upgrade upgrade the cluster Upgrade(*v1alpha1.TiflowCluster, *apps.StatefulSet, *apps.StatefulSet) error }
Upgrader implements the logic for upgrading the tiflow cluster.
func NewExecutorUpgrader ¶
NewExecutorUpgrader returns a executorUpgrader
func NewMasterUpgrader ¶
NewMasterUpgrader returns a masterUpgrader