Documentation ¶
Index ¶
- Constants
- type AWSSnapshotter
- func (s *AWSSnapshotter) AddVolumeTags(pvs []*corev1.PersistentVolume) error
- func (s *AWSSnapshotter) GenerateBackupMetadata(b *v1alpha1.Backup, tc *v1alpha1.TidbCluster) (*CloudSnapBackup, string, error)
- func (s *AWSSnapshotter) GetVolumeID(pv *corev1.PersistentVolume) (string, error)
- func (s *AWSSnapshotter) Init(deps *controller.Dependencies, conf map[string]string) error
- func (s *AWSSnapshotter) PrepareRestoreMetadata(r *v1alpha1.Restore, csb *CloudSnapBackup) (string, error)
- func (s *AWSSnapshotter) ResetPvAvailableZone(r *v1alpha1.Restore, pv *corev1.PersistentVolume)
- func (s *AWSSnapshotter) SetVolumeID(pv *corev1.PersistentVolume, volumeID string) error
- type BaseSnapshotter
- type CloudSnapBackup
- type Component
- type GCPSnapshotter
- func (s *GCPSnapshotter) AddVolumeTags(pvs []*corev1.PersistentVolume) error
- func (s *GCPSnapshotter) GenerateBackupMetadata(b *v1alpha1.Backup, tc *v1alpha1.TidbCluster) (*CloudSnapBackup, string, error)
- func (s *GCPSnapshotter) GetVolumeID(pv *corev1.PersistentVolume) (string, error)
- func (s *GCPSnapshotter) Init(deps *controller.Dependencies, conf map[string]string) error
- func (s *GCPSnapshotter) PrepareRestoreMetadata(r *v1alpha1.Restore, csb *CloudSnapBackup) (string, error)
- func (s *GCPSnapshotter) ResetPvAvailableZone(r *v1alpha1.Restore, pv *corev1.PersistentVolume)
- func (s *GCPSnapshotter) SetVolumeID(pv *corev1.PersistentVolume, volumeID string) error
- type KubernetesBackup
- type NoneSnapshotter
- func (s *NoneSnapshotter) AddVolumeTags(pvs []*corev1.PersistentVolume) error
- func (s *NoneSnapshotter) GenerateBackupMetadata(b *v1alpha1.Backup, tc *v1alpha1.TidbCluster) (*CloudSnapBackup, string, error)
- func (s *NoneSnapshotter) GetVolumeID(pv *corev1.PersistentVolume) (string, error)
- func (s *NoneSnapshotter) Init(deps *controller.Dependencies, conf map[string]string) error
- func (s *NoneSnapshotter) PrepareRestoreMetadata(r *v1alpha1.Restore, csb *CloudSnapBackup) (string, error)
- func (s *NoneSnapshotter) ResetPvAvailableZone(r *v1alpha1.Restore, pv *corev1.PersistentVolume)
- func (s *NoneSnapshotter) SetVolumeID(pv *corev1.PersistentVolume, volumeID string) error
- type Snapshotter
- type StoresBackup
- type StoresMixture
- type TiKVBackup
- type VolumeBackup
Constants ¶
View Source
const ( CloudAPIConcurrency = 8 PVCTagKey = "CSIVolumeName" PodTagKey = "kubernetes.io/created-for/pvc/name" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSSnapshotter ¶
type AWSSnapshotter struct {
BaseSnapshotter
}
AWSSnapshotter is the snapshotter for creating snapshots from volumes (during a backup) and volumes from snapshots (during a restore) on AWS EBS.
func (*AWSSnapshotter) AddVolumeTags ¶ added in v1.5.0
func (s *AWSSnapshotter) AddVolumeTags(pvs []*corev1.PersistentVolume) error
func (*AWSSnapshotter) GenerateBackupMetadata ¶
func (s *AWSSnapshotter) GenerateBackupMetadata(b *v1alpha1.Backup, tc *v1alpha1.TidbCluster) (*CloudSnapBackup, string, error)
func (*AWSSnapshotter) GetVolumeID ¶
func (s *AWSSnapshotter) GetVolumeID(pv *corev1.PersistentVolume) (string, error)
func (*AWSSnapshotter) Init ¶
func (s *AWSSnapshotter) Init(deps *controller.Dependencies, conf map[string]string) error
func (*AWSSnapshotter) PrepareRestoreMetadata ¶
func (s *AWSSnapshotter) PrepareRestoreMetadata(r *v1alpha1.Restore, csb *CloudSnapBackup) (string, error)
func (*AWSSnapshotter) ResetPvAvailableZone ¶ added in v1.5.0
func (s *AWSSnapshotter) ResetPvAvailableZone(r *v1alpha1.Restore, pv *corev1.PersistentVolume)
func (*AWSSnapshotter) SetVolumeID ¶
func (s *AWSSnapshotter) SetVolumeID(pv *corev1.PersistentVolume, volumeID string) error
type BaseSnapshotter ¶
type BaseSnapshotter struct {
// contains filtered or unexported fields
}
func (*BaseSnapshotter) Init ¶
func (s *BaseSnapshotter) Init(deps *controller.Dependencies, conf map[string]string) error
func (*BaseSnapshotter) PrepareCSBK8SMeta ¶
func (s *BaseSnapshotter) PrepareCSBK8SMeta(csb *CloudSnapBackup, tc *v1alpha1.TidbCluster) ([]*corev1.Pod, string, error)
type CloudSnapBackup ¶
type CloudSnapBackup struct { TiKV *TiKVBackup `json:"tikv"` PD Component `json:"pd"` TiDB Component `json:"tidb"` Kubernetes *KubernetesBackup `json:"kubernetes"` Options map[string]interface{} `json:"options"` }
func NewCloudSnapshotBackup ¶
func NewCloudSnapshotBackup(tc *v1alpha1.TidbCluster) (csb *CloudSnapBackup)
type GCPSnapshotter ¶
type GCPSnapshotter struct {
BaseSnapshotter
}
The GCPSnapshotter for creating snapshots from volumes (during a backup) and volumes from snapshots (during a restore) on Google Compute Engine Disks.
func (*GCPSnapshotter) AddVolumeTags ¶ added in v1.5.0
func (s *GCPSnapshotter) AddVolumeTags(pvs []*corev1.PersistentVolume) error
func (*GCPSnapshotter) GenerateBackupMetadata ¶
func (s *GCPSnapshotter) GenerateBackupMetadata(b *v1alpha1.Backup, tc *v1alpha1.TidbCluster) (*CloudSnapBackup, string, error)
func (*GCPSnapshotter) GetVolumeID ¶
func (s *GCPSnapshotter) GetVolumeID(pv *corev1.PersistentVolume) (string, error)
func (*GCPSnapshotter) Init ¶
func (s *GCPSnapshotter) Init(deps *controller.Dependencies, conf map[string]string) error
func (*GCPSnapshotter) PrepareRestoreMetadata ¶
func (s *GCPSnapshotter) PrepareRestoreMetadata(r *v1alpha1.Restore, csb *CloudSnapBackup) (string, error)
func (*GCPSnapshotter) ResetPvAvailableZone ¶ added in v1.5.0
func (s *GCPSnapshotter) ResetPvAvailableZone(r *v1alpha1.Restore, pv *corev1.PersistentVolume)
func (*GCPSnapshotter) SetVolumeID ¶
func (s *GCPSnapshotter) SetVolumeID(pv *corev1.PersistentVolume, volumeID string) error
type KubernetesBackup ¶
type KubernetesBackup struct { PVCs []*corev1.PersistentVolumeClaim `json:"pvcs"` PVs []*corev1.PersistentVolume `json:"pvs"` TiDBCluster *v1alpha1.TidbCluster `json:"crd_tidb_cluster"` Unstructured *unstructured.Unstructured `json:"options"` }
type NoneSnapshotter ¶
type NoneSnapshotter struct { }
func (*NoneSnapshotter) AddVolumeTags ¶ added in v1.5.0
func (s *NoneSnapshotter) AddVolumeTags(pvs []*corev1.PersistentVolume) error
func (*NoneSnapshotter) GenerateBackupMetadata ¶
func (s *NoneSnapshotter) GenerateBackupMetadata(b *v1alpha1.Backup, tc *v1alpha1.TidbCluster) (*CloudSnapBackup, string, error)
func (*NoneSnapshotter) GetVolumeID ¶
func (s *NoneSnapshotter) GetVolumeID(pv *corev1.PersistentVolume) (string, error)
func (*NoneSnapshotter) Init ¶
func (s *NoneSnapshotter) Init(deps *controller.Dependencies, conf map[string]string) error
func (*NoneSnapshotter) PrepareRestoreMetadata ¶
func (s *NoneSnapshotter) PrepareRestoreMetadata(r *v1alpha1.Restore, csb *CloudSnapBackup) (string, error)
func (*NoneSnapshotter) ResetPvAvailableZone ¶ added in v1.5.0
func (s *NoneSnapshotter) ResetPvAvailableZone(r *v1alpha1.Restore, pv *corev1.PersistentVolume)
func (*NoneSnapshotter) SetVolumeID ¶
func (s *NoneSnapshotter) SetVolumeID(pv *corev1.PersistentVolume, volumeID string) error
type Snapshotter ¶
type Snapshotter interface { // Init prepares the Snapshotter for usage, it would add // specific parameters as config map[string]string in the future. Init(deps *controller.Dependencies, conf map[string]string) error // GetVolumeID returns the cloud provider specific identifier // for the PersistentVolume-PV. GetVolumeID(pv *corev1.PersistentVolume) (string, error) // GenerateBackupMetadata performs the preparations for creating // a snapshot from the used volume for PV/PVC. GenerateBackupMetadata(b *v1alpha1.Backup, tc *v1alpha1.TidbCluster) (*CloudSnapBackup, string, error) // PrepareRestoreMetadata performs the preparations for creating // a volume from the snapshot that has been backed up. PrepareRestoreMetadata(r *v1alpha1.Restore, csb *CloudSnapBackup) (string, error) // SetVolumeID sets the cloud provider specific identifier // for the PersistentVolume-PV. SetVolumeID(pv *corev1.PersistentVolume, volumeID string) error // ResetPvAvailableZone resets az of pv if the volumes restore to another az ResetPvAvailableZone(r *v1alpha1.Restore, pv *corev1.PersistentVolume) // AddVolumeTags add operator related tags to volumes AddVolumeTags(pvs []*corev1.PersistentVolume) error }
func NewSnapshotterForBackup ¶
func NewSnapshotterForBackup(m v1alpha1.BackupMode, d *controller.Dependencies) (Snapshotter, string, error)
func NewSnapshotterForRestore ¶
func NewSnapshotterForRestore(m v1alpha1.RestoreMode, d *controller.Dependencies) (Snapshotter, string, error)
type StoresBackup ¶
type StoresBackup struct { StoreID uint64 `json:"store_id"` Volumes []*VolumeBackup `json:"volumes"` }
type StoresMixture ¶
type StoresMixture struct {
// contains filtered or unexported fields
}
func NewBackupStoresMixture ¶
func NewBackupStoresMixture( tc *v1alpha1.TidbCluster, pvcs []*corev1.PersistentVolumeClaim, pvs []*corev1.PersistentVolume, s Snapshotter) *StoresMixture
func NewRestoreStoresMixture ¶
func NewRestoreStoresMixture(s Snapshotter) *StoresMixture
func (*StoresMixture) PrepareCSBStoresMeta ¶
func (m *StoresMixture) PrepareCSBStoresMeta(csb *CloudSnapBackup, pods []*corev1.Pod) (string, error)
func (*StoresMixture) ProcessCSBPVCsAndPVs ¶
func (m *StoresMixture) ProcessCSBPVCsAndPVs(r *v1alpha1.Restore, csb *CloudSnapBackup) (string, error)
func (*StoresMixture) SetPod ¶
func (m *StoresMixture) SetPod(pod *corev1.Pod)
type TiKVBackup ¶
type TiKVBackup struct { Component Stores []*StoresBackup `json:"stores"` }
Click to show internal directories.
Click to hide internal directories.