Documentation
¶
Index ¶
- Constants
- func GetApiserverPod(kubeCli kubernetes.Interface, node string) (*corev1.Pod, error)
- func GetControllerManagerPod(kubeCli kubernetes.Interface, node string) (*corev1.Pod, error)
- func GetDnsPod(kubeCli kubernetes.Interface, node string) (*corev1.Pod, error)
- func GetKubeComponent(kubeCli kubernetes.Interface, node string, componentName string) (*corev1.Pod, error)
- func GetPodStatus(pod *corev1.Pod) string
- func GetSchedulerPod(kubeCli kubernetes.Interface, node string) (*corev1.Pod, error)
- func KeepOrDie(interval time.Duration, period time.Duration, fun func() error)
- func SelectNode(nodes []Nodes) string
- type Config
- type FaultTriggerActions
- type Nodes
- type OperatorActions
- type OperatorConfig
- type TidbClusterConfig
- func (tc *TidbClusterConfig) BackupHelmSetString(m map[string]string) string
- func (tc *TidbClusterConfig) DSN(dbName string) string
- func (info *TidbClusterConfig) DataIsTheSameAs(otherInfo *TidbClusterConfig) (bool, error)
- func (info *TidbClusterConfig) FullName() string
- func (tc *TidbClusterConfig) ScalePD(replicas uint) *TidbClusterConfig
- func (tc *TidbClusterConfig) ScaleTiDB(replicas uint) *TidbClusterConfig
- func (tc *TidbClusterConfig) ScaleTiKV(replicas uint) *TidbClusterConfig
- func (tc *TidbClusterConfig) String() string
- func (tc *TidbClusterConfig) TidbClusterHelmSetString(m map[string]string) string
- func (tc *TidbClusterConfig) UpgradeAll(tag string) *TidbClusterConfig
- func (tc *TidbClusterConfig) UpgradePD(image string) *TidbClusterConfig
- func (tc *TidbClusterConfig) UpgradeTiDB(image string) *TidbClusterConfig
- func (tc *TidbClusterConfig) UpgradeTiKV(image string) *TidbClusterConfig
Constants ¶
View Source
const ( DefaultPollTimeout time.Duration = 10 * time.Minute DefaultPollInterval time.Duration = 1 * time.Minute BackupAndRestorePollTimeOut time.Duration = 30 * time.Minute )
View Source
const ( // NodeUnreachablePodReason is defined in k8s.io/kubernetes/pkg/util/node // but not in client-go and apimachinery, so we define it here NodeUnreachablePodReason = "NodeLost" )
Variables ¶
This section is empty.
Functions ¶
func GetApiserverPod ¶
func GetControllerManagerPod ¶
func GetKubeComponent ¶
func GetPodStatus ¶
func GetSchedulerPod ¶
func SelectNode ¶
Types ¶
type Config ¶
type Config struct {
TidbVersions string `yaml:"tidb_versions" json:"tidb_versions"`
OperatorTag string `yaml:"operator_tag" json:"operator_tag"`
OperatorImage string `yaml:"operator_image" json:"operator_image"`
LogDir string `yaml:"log_dir" json:"log_dir"`
FaultTriggerPort int `yaml:"fault_trigger_port" json:"fault_trigger_port"`
Nodes []Nodes `yaml:"nodes" json:"nodes"`
ETCDs []Nodes `yaml:"etcds" json:"etcds"`
APIServers []Nodes `yaml:"apiservers" json:"apiservers"`
CertFile string
KeyFile string
// Block writer
BlockWriter blockwriter.Config `yaml:"block_writer,omitempty"`
// For local test
OperatorRepoDir string `yaml:"operator_repo_dir" json:"operator_repo_dir"`
// chart dir
ChartDir string `yaml:"chart_dir" json:"chart_dir"`
// contains filtered or unexported fields
}
Config defines the config of operator tests
func ParseConfigOrDie ¶
func ParseConfigOrDie() *Config
func (*Config) CleanTempDirs ¶
func (*Config) GetTiDBVersion ¶
func (*Config) GetTiDBVersionOrDie ¶
func (*Config) GetUpgradeTidbVersions ¶
func (*Config) GetUpgradeTidbVersionsOrDie ¶
type FaultTriggerActions ¶
type FaultTriggerActions interface {
CheckAndRecoverEnv() error
CheckAndRecoverEnvOrDie()
StopNode() (string, string, time.Time, error)
StopNodeOrDie() (string, string, time.Time)
StartNode(physicalNode string, node string) error
StartNodeOrDie(physicalNode string, node string)
StopETCD(nodes ...string) error
StopETCDOrDie(nodes ...string)
StartETCD(nodes ...string) error
StartETCDOrDie(nodes ...string)
StopKubelet(node string) error
StartKubelet(node string) error
StopKubeAPIServer(node string) error
StopKubeAPIServerOrDie(node string)
StartKubeAPIServer(node string) error
StartKubeAPIServerOrDie(node string)
StopKubeControllerManager(node string) error
StartKubeControllerManager(node string) error
StopKubeScheduler(node string) error
StartKubeScheduler(node string) error
}
func NewFaultTriggerAction ¶
func NewFaultTriggerAction(cli versioned.Interface, kubeCli kubernetes.Interface, cfg *Config) FaultTriggerActions
type Nodes ¶
type Nodes struct {
PhysicalNode string `yaml:"physical_node" json:"physical_node"`
Nodes []string `yaml:"nodes" json:"nodes"`
}
Nodes defines a series of nodes that belong to the same physical node.
type OperatorActions ¶
type OperatorActions interface {
DeployOperator(info *OperatorConfig) error
DeployOperatorOrDie(info *OperatorConfig)
CleanOperator(info *OperatorConfig) error
CleanOperatorOrDie(info *OperatorConfig)
UpgradeOperator(info *OperatorConfig) error
DumpAllLogs(info *OperatorConfig, clusterInfos []*TidbClusterConfig) error
DeployTidbCluster(info *TidbClusterConfig) error
DeployTidbClusterOrDie(info *TidbClusterConfig)
CleanTidbCluster(info *TidbClusterConfig) error
CleanTidbClusterOrDie(info *TidbClusterConfig)
CheckTidbClusterStatus(info *TidbClusterConfig) error
CheckTidbClusterStatusOrDie(info *TidbClusterConfig)
BeginInsertDataTo(info *TidbClusterConfig) error
BeginInsertDataToOrDie(info *TidbClusterConfig)
StopInsertDataTo(info *TidbClusterConfig)
ScaleTidbCluster(info *TidbClusterConfig) error
ScaleTidbClusterOrDie(info *TidbClusterConfig)
CheckScaleInSafely(info *TidbClusterConfig) error
CheckScaledCorrectly(info *TidbClusterConfig, podUIDsBeforeScale map[string]types.UID) error
UpgradeTidbCluster(info *TidbClusterConfig) error
UpgradeTidbClusterOrDie(info *TidbClusterConfig)
CheckUpgradeProgress(info *TidbClusterConfig) error
DeployAdHocBackup(info *TidbClusterConfig) error
CheckAdHocBackup(info *TidbClusterConfig) error
DeployScheduledBackup(info *TidbClusterConfig) error
CheckScheduledBackup(info *TidbClusterConfig) error
DeployIncrementalBackup(from *TidbClusterConfig, to *TidbClusterConfig) error
CheckIncrementalBackup(info *TidbClusterConfig) error
Restore(from *TidbClusterConfig, to *TidbClusterConfig) error
CheckRestore(from *TidbClusterConfig, to *TidbClusterConfig) error
ForceDeploy(info *TidbClusterConfig) error
CreateSecret(info *TidbClusterConfig) error
GetPodUIDMap(info *TidbClusterConfig) (map[string]types.UID, error)
GetNodeMap(info *TidbClusterConfig, component string) (map[string][]string, error)
TruncateSSTFileThenCheckFailover(info *TidbClusterConfig, tikvFailoverPeriod time.Duration) error
TruncateSSTFileThenCheckFailoverOrDie(info *TidbClusterConfig, tikvFailoverPeriod time.Duration)
CheckFailoverPending(info *TidbClusterConfig, node string, faultPoint *time.Time) (bool, error)
CheckFailoverPendingOrDie(clusters []*TidbClusterConfig, node string, faultPoint *time.Time)
CheckFailover(info *TidbClusterConfig, faultNode string) (bool, error)
CheckFailoverOrDie(clusters []*TidbClusterConfig, faultNode string)
CheckRecover(cluster *TidbClusterConfig) (bool, error)
CheckRecoverOrDie(clusters []*TidbClusterConfig)
CheckK8sAvailable(excludeNodes map[string]string, excludePods map[string]*corev1.Pod) error
CheckK8sAvailableOrDie(excludeNodes map[string]string, excludePods map[string]*corev1.Pod)
CheckOperatorAvailable(operatorConfig *OperatorConfig) error
CheckTidbClustersAvailable(infos []*TidbClusterConfig) error
CheckOneEtcdDownOrDie(operatorConfig *OperatorConfig, clusters []*TidbClusterConfig, faultNode string)
CheckOneApiserverDownOrDie(operatorConfig *OperatorConfig, clusters []*TidbClusterConfig, faultNode string)
RegisterWebHookAndService(info *OperatorConfig) error
RegisterWebHookAndServiceOrDie(info *OperatorConfig)
CleanWebHookAndService(info *OperatorConfig) error
StartValidatingAdmissionWebhookServerOrDie(info *OperatorConfig)
EventWorker()
EmitEvent(info *TidbClusterConfig, msg string)
BackupRestore(from, to *TidbClusterConfig) error
BackupRestoreOrDie(from, to *TidbClusterConfig)
}
func NewOperatorActions ¶
func NewOperatorActions(cli versioned.Interface, kubeCli kubernetes.Interface, pollInterval time.Duration, cfg *Config, clusters []*TidbClusterConfig) OperatorActions
type OperatorConfig ¶
type OperatorConfig struct {
Namespace string
ReleaseName string
Image string
Tag string
SchedulerImage string
SchedulerTag string
LogLevel string
WebhookServiceName string
WebhookSecretName string
WebhookConfigName string
Context *apimachinery.CertContext
}
func (*OperatorConfig) ConfigTLS ¶
func (oi *OperatorConfig) ConfigTLS() *tls.Config
func (*OperatorConfig) OperatorHelmSetString ¶
func (oi *OperatorConfig) OperatorHelmSetString(m map[string]string) string
type TidbClusterConfig ¶
type TidbClusterConfig struct {
BackupName string
Namespace string
ClusterName string
OperatorTag string
PDImage string
TiKVImage string
TiDBImage string
StorageClassName string
Password string
InitSql string
RecordCount string
InsertBatchSize string
Resources map[string]string
Args map[string]string
Monitor bool
UserName string
InitSecretName string
BackupSecretName string
BlockWriteConfig blockwriter.Config
GrafanaClient *metrics.Client
// contains filtered or unexported fields
}
func (*TidbClusterConfig) BackupHelmSetString ¶
func (tc *TidbClusterConfig) BackupHelmSetString(m map[string]string) string
func (*TidbClusterConfig) DSN ¶
func (tc *TidbClusterConfig) DSN(dbName string) string
func (*TidbClusterConfig) DataIsTheSameAs ¶
func (info *TidbClusterConfig) DataIsTheSameAs(otherInfo *TidbClusterConfig) (bool, error)
func (*TidbClusterConfig) FullName ¶
func (info *TidbClusterConfig) FullName() string
func (*TidbClusterConfig) ScalePD ¶
func (tc *TidbClusterConfig) ScalePD(replicas uint) *TidbClusterConfig
func (*TidbClusterConfig) ScaleTiDB ¶
func (tc *TidbClusterConfig) ScaleTiDB(replicas uint) *TidbClusterConfig
func (*TidbClusterConfig) ScaleTiKV ¶
func (tc *TidbClusterConfig) ScaleTiKV(replicas uint) *TidbClusterConfig
func (*TidbClusterConfig) String ¶
func (tc *TidbClusterConfig) String() string
func (*TidbClusterConfig) TidbClusterHelmSetString ¶
func (tc *TidbClusterConfig) TidbClusterHelmSetString(m map[string]string) string
func (*TidbClusterConfig) UpgradeAll ¶
func (tc *TidbClusterConfig) UpgradeAll(tag string) *TidbClusterConfig
func (*TidbClusterConfig) UpgradePD ¶
func (tc *TidbClusterConfig) UpgradePD(image string) *TidbClusterConfig
func (*TidbClusterConfig) UpgradeTiDB ¶
func (tc *TidbClusterConfig) UpgradeTiDB(image string) *TidbClusterConfig
func (*TidbClusterConfig) UpgradeTiKV ¶
func (tc *TidbClusterConfig) UpgradeTiKV(image string) *TidbClusterConfig
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
e2e
command
|
|
|
fault-trigger
command
|
|
|
stability
command
|
|
|
pkg
|
|
|
validation
module
|
Click to show internal directories.
Click to hide internal directories.