Documentation
¶
Index ¶
- type CLIConfig
- type Config
- type Controls
- type Dependencies
- type Duration
- type FakeServerlessDBControl
- func (c *FakeServerlessDBControl) Create(*v1alpha1.ServerlessDB) error
- func (c *FakeServerlessDBControl) Patch(tc *v1alpha1.ServerlessDB, data []byte, subresources ...string) (result *v1alpha1.ServerlessDB, err error)
- func (c *FakeServerlessDBControl) RecordServerlessDBEvent(verb, message string, object runtime.Object, err error)
- func (c *FakeServerlessDBControl) Update(db *v1alpha1.ServerlessDB) (*v1alpha1.ServerlessDB, error)
- func (c *FakeServerlessDBControl) UpdateServerlessDB(db *v1alpha1.ServerlessDB, newStatus *v1alpha1.ServerlessDBStatus, ...) (*v1alpha1.ServerlessDB, error)
- type Monitor
- type Proxy
- type RequestTracker
- type ResourceList
- type ResourceRequirements
- type ServerlessDBControlInterface
- type Specification
- type Storage
- type TiDBCluster
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLIConfig ¶
type CLIConfig struct { PrintVersion bool // The number of workers that are allowed to sync concurrently. // Larger number = more responsive management, but more CPU // (and network) load Workers int // Controls whether operator should manage kubernetes cluster LeaseDuration time.Duration RenewDuration time.Duration RetryPeriod time.Duration WaitDuration time.Duration // ResyncDuration is the resync time of informer ResyncDuration time.Duration // Defines whether tidb operator run in test mode, test mode is // only open when test TestMode bool // Selector is used to filter CR labels to decide // what resources should be watched and synced by controller Selector string // Default config read from config file Config Config InstanceFetchInterval time.Duration ReadonlyAvailPercentage float64 ProxyComponentHttpPort int // contains filtered or unexported fields }
CLIConfig is used save all configuration read from command line parameters
func DefaultCLIConfig ¶
func DefaultCLIConfig() *CLIConfig
DefaultCLIConfig returns the default command line configuration
type Config ¶
type Config struct { Duration Duration `yaml:"duration"` Storage Storage `yaml:"storage"` TiDBCluster TiDBCluster `yaml:"tidbCluster"` Monitor Monitor `yaml:"monitor"` Proxy Proxy `yaml:"proxy"` }
type Controls ¶
type Controls struct {
ServerlessControl ServerlessDBControlInterface
}
type Dependencies ¶
type Dependencies struct { // CLIConfig represents all parameters read from command line CLIConfig *CLIConfig RestConfig *restclient.Config // Operator client interface Clientset versioned.Interface // pingcap client interface PingcapClientset pcversioned.Interface // Kubernetes client interface KubeClientset kubernetes.Interface GenericClient client.Client InformerFactory informers.SharedInformerFactory PingcapInformerFactory pcinformers.SharedInformerFactory KubeInformerFactory kubeinformers.SharedInformerFactory LabelFilterKubeInformerFactory kubeinformers.SharedInformerFactory Recorder record.EventRecorder // Listers PodLister corelisterv1.PodLister JobLister batchlisters.JobLister ServiceLister corelisterv1.ServiceLister SecretLister corelisterv1.SecretLister PVCLister corelisterv1.PersistentVolumeClaimLister DeploymentLister appslisters.DeploymentLister StatefulSetLister appslisters.StatefulSetLister ServerlessDBLister listers.ServerlessDBLister TiDBClusterLister pclisters.TidbClusterLister TiDBMonitorLister pclisters.TidbMonitorLister TiDBInitializerLister pclisters.TidbInitializerLister PcBackupLister pclisters.BackupLister PcBackupScheduleLister pclisters.BackupScheduleLister PcRestoreLister pclisters.RestoreLister // Controls Controls }
Dependencies is used to store all shared dependent resources to avoid pass parameters everywhere.
func NewDependencies ¶
func NewDependencies(ns string, cliCfg *CLIConfig, restConfig *restclient.Config, clientset versioned.Interface, pcCliset pcversioned.Interface, kubeClientset kubernetes.Interface, genericCli client.Client) *Dependencies
NewDependencies is used to construct the dependencies
func NewFakeDependencies ¶
func NewFakeDependencies() *Dependencies
NewFakeDependencies returns a fake dependencies for testing
type FakeServerlessDBControl ¶
type FakeServerlessDBControl struct { SlLister listers.ServerlessDBLister SlIndexer cache.Indexer // contains filtered or unexported fields }
FakeTidbClusterControl is a fake TidbClusterControlInterface
func NewFakeServerlessDBControl ¶
func NewFakeServerlessDBControl(slInformer informers.ServerlessDBInformer) *FakeServerlessDBControl
NewFakeTidbClusterControl returns a FakeTidbClusterControl
func (*FakeServerlessDBControl) Create ¶
func (c *FakeServerlessDBControl) Create(*v1alpha1.ServerlessDB) error
func (*FakeServerlessDBControl) Patch ¶
func (c *FakeServerlessDBControl) Patch(tc *v1alpha1.ServerlessDB, data []byte, subresources ...string) (result *v1alpha1.ServerlessDB, err error)
func (*FakeServerlessDBControl) RecordServerlessDBEvent ¶
func (c *FakeServerlessDBControl) RecordServerlessDBEvent(verb, message string, object runtime.Object, err error)
func (*FakeServerlessDBControl) Update ¶
func (c *FakeServerlessDBControl) Update(db *v1alpha1.ServerlessDB) (*v1alpha1.ServerlessDB, error)
func (*FakeServerlessDBControl) UpdateServerlessDB ¶
func (c *FakeServerlessDBControl) UpdateServerlessDB(db *v1alpha1.ServerlessDB, newStatus *v1alpha1.ServerlessDBStatus, oldStatus *v1alpha1.ServerlessDBStatus) (*v1alpha1.ServerlessDB, error)
type Monitor ¶
type Monitor struct { Specification `yaml:",inline"` PrometheusReserveDays int `yaml:"prometheusReserveDays"` }
type Proxy ¶
type Proxy struct {
Specification `yaml:",inline"`
}
type RequestTracker ¶
type RequestTracker struct {
// contains filtered or unexported fields
}
RequestTracker is used by unit test for mocking request error
type ResourceList ¶
type ResourceRequirements ¶
type ResourceRequirements struct { Limits ResourceList `yaml:"limits"` Requests ResourceList `yaml:"requests"` }
ResourceRequirements describes the compute resource requirements.
func (*ResourceRequirements) ParseResource ¶
func (r *ResourceRequirements) ParseResource() corev1.ResourceRequirements
type ServerlessDBControlInterface ¶
type ServerlessDBControlInterface interface { Update(db *v1alpha1.ServerlessDB) (*v1alpha1.ServerlessDB, error) UpdateServerlessDB(*v1alpha1.ServerlessDB, *v1alpha1.ServerlessDBStatus, *v1alpha1.ServerlessDBStatus) (*v1alpha1.ServerlessDB, error) Create(*v1alpha1.ServerlessDB) error Patch(tc *v1alpha1.ServerlessDB, data []byte, subresources ...string) (result *v1alpha1.ServerlessDB, err error) RecordServerlessDBEvent(verb, message string, object runtime.Object, err error) }
ServerlessDBControlInterface manages ServerlessDB
func NewRealServerlessDBControl ¶
func NewRealServerlessDBControl(cli versioned.Interface, dbLister listers.ServerlessDBLister, recorder record.EventRecorder) ServerlessDBControlInterface
NewRealServerlessDBControl creates a new ServerlessDBControlInterface
type Specification ¶
type Specification struct { Enable bool `yaml:"enable"` Image string `yaml:"image"` Replicas int32 `yaml:"replicas"` ResourceRequirements `yaml:",inline"` }
type TiDBCluster ¶
type TiDBCluster struct { Version string `yaml:"version"` PD Specification `yaml:"pd"` TiDB Specification `yaml:"tidb"` TiKV Specification `yaml:"tikv"` }