Documentation ¶
Index ¶
- Constants
- type Label
- func (l Label) Backup(val string) Label
- func (l Label) BackupJob() Label
- func (l Label) BackupSchedule(val string) Label
- func (l Label) CleanJob() Label
- func (l Label) Component(name string) Label
- func (l Label) ComponentType() string
- func (l Label) Discovery() Label
- func (l Label) Initializer(val string) Label
- func (l Label) Instance(name string) Label
- func (l Label) IsManagedByTiDBOperator() bool
- func (l Label) IsPD() bool
- func (l Label) IsTiDB() bool
- func (l Label) IsTiKV() bool
- func (l Label) LabelSelector() *metav1.LabelSelector
- func (l Label) Labels() map[string]string
- func (l Label) Monitor() Label
- func (l Label) Namespace(name string) Label
- func (l Label) PD() Label
- func (l Label) Pump() Label
- func (l Label) Restore(val string) Label
- func (l Label) RestoreJob() Label
- func (l Label) Selector() (labels.Selector, error)
- func (l Label) String() string
- func (l Label) TiDB() Label
- func (l Label) TiFlash() Label
- func (l Label) TiKV() Label
Constants ¶
View Source
const ( // ManagedByLabelKey is Kubernetes recommended label key, it represents the tool being used to manage the operation of an application // For resources managed by TiDB Operator, its value is always tidb-operator ManagedByLabelKey string = "app.kubernetes.io/managed-by" // ComponentLabelKey is Kubernetes recommended label key, it represents the component within the architecture ComponentLabelKey string = "app.kubernetes.io/component" // NameLabelKey is Kubernetes recommended label key, it represents the name of the application // It should always be tidb-cluster in our case. NameLabelKey string = "app.kubernetes.io/name" // InstanceLabelKey is Kubernetes recommended label key, it represents a unique name identifying the instance of an application // It's set by helm when installing a release InstanceLabelKey string = "app.kubernetes.io/instance" // NamespaceLabelKey is label key used in PV for easy querying NamespaceLabelKey string = "app.kubernetes.io/namespace" // ClusterIDLabelKey is cluster id label key ClusterIDLabelKey string = "tidb.pingcap.com/cluster-id" // StoreIDLabelKey is store id label key StoreIDLabelKey string = "tidb.pingcap.com/store-id" // MemberIDLabelKey is member id label key MemberIDLabelKey string = "tidb.pingcap.com/member-id" // InitLabelKey is the key for TiDB initializer InitLabelKey string = "tidb.pingcap.com/initializer" // BackupScheduleLabelKey is backup schedule key BackupScheduleLabelKey string = "tidb.pingcap.com/backup-schedule" // BackupLabelKey is backup key BackupLabelKey string = "tidb.pingcap.com/backup" // RestoreLabelKey is restore key RestoreLabelKey string = "tidb.pingcap.com/restore" // BackupProtectionFinalizer is the name of finalizer on backups BackupProtectionFinalizer string = "tidb.pingcap.com/backup-protection" // AnnFailTiDBScheduler is for injecting a failure into the TiDB custom scheduler // A pod with this annotation will produce an error when scheduled. AnnFailTiDBScheduler string = "tidb.pingcap.com/fail-scheduler" // AnnPodNameKey is pod name annotation key used in PV/PVC for synchronizing tidb cluster meta info AnnPodNameKey string = "tidb.pingcap.com/pod-name" // AnnPVCDeferDeleting is pvc defer deletion annotation key used in PVC for defer deleting PVC AnnPVCDeferDeleting = "tidb.pingcap.com/pvc-defer-deleting" // AnnPVCPodScheduling is pod scheduling annotation key, it represents whether the pod is scheduling AnnPVCPodScheduling = "tidb.pingcap.com/pod-scheduling" // AnnTiDBPartition is pod annotation which TiDB pod should upgrade to AnnTiDBPartition string = "tidb.pingcap.com/tidb-partition" // AnnTiKVPartition is pod annotation which TiKV pod should upgrade to AnnTiKVPartition string = "tidb.pingcap.com/tikv-partition" // AnnForceUpgradeKey is tc annotation key to indicate whether force upgrade should be done AnnForceUpgradeKey = "tidb.pingcap.com/force-upgrade" // AnnPDDeferDeleting is pd pod annotation key in pod for defer for deleting pod AnnPDDeferDeleting = "tidb.pingcap.com/pd-defer-deleting" // AnnSysctlInit is pod annotation key to indicate whether configuring sysctls with init container AnnSysctlInit = "tidb.pingcap.com/sysctl-init" // AnnEvictLeaderBeginTime is pod annotation key to indicate the begin time for evicting region leader AnnEvictLeaderBeginTime = "tidb.pingcap.com/evictLeaderBeginTime" // AnnPodDeferDeleting is pod annotation key to indicate the pod which need to be restarted AnnPodDeferDeleting = "tidb.pingcap.com/pod-defer-deleting" // AnnStsSyncTimestamp is sts annotation key to indicate the last timestamp the operator sync the sts AnnStsLastSyncTimestamp = "tidb.pingcap.com/sync-timestamp" // AnnForceUpgradeVal is tc annotation value to indicate whether force upgrade should be done AnnForceUpgradeVal = "true" // AnnSysctlInitVal is pod annotation value to indicate whether configuring sysctls with init container AnnSysctlInitVal = "true" // AnnPDDeleteSlots is annotation key of pd delete slots. AnnPDDeleteSlots = "pd.tidb.pingcap.com/delete-slots" // TiDBDeleteSlots is annotation key of tidb delete slots. AnnTiDBDeleteSlots = "tidb.tidb.pingcap.com/delete-slots" // TiKVDeleteSlots is annotation key of tikv delete slots. AnnTiKVDeleteSlots = "tikv.tidb.pingcap.com/delete-slots" // AnnTiDBLastAutoScalingTimestamp is annotation key of tidbcluster to indicate the last timestamp for tidb auto-scaling AnnTiDBLastAutoScalingTimestamp = "tidb.tidb.pingcap.com/last-autoscaling-timestamp" // AnnTiKVLastAutoScalingTimestamp is annotation key of tidbclusterto which ordinal is created by tikv auto-scaling AnnTiKVLastAutoScalingTimestamp = "tikv.tidb.pingcap.com/last-autoscaling-timestamp" // AnnTiDBConsecutiveScaleOutCount describes the least consecutive count to scale-out for tidb AnnTiDBConsecutiveScaleOutCount = "tidb.tidb.pingcap.com/consecutive-scale-out-count" // AnnTiDBConsecutiveScaleInCount describes the least consecutive count to scale-in for tidb AnnTiDBConsecutiveScaleInCount = "tidb.tidb.pingcap.com/consecutive-scale-in-count" // AnnTiKVConsecutiveScaleOutCount describes the least consecutive count to scale-out for tikv AnnTiKVConsecutiveScaleOutCount = "tikv.tidb.pingcap.com/consecutive-scale-out-count" // AnnTiKVConsecutiveScaleInCount describes the least consecutive count to scale-in for tikv AnnTiKVConsecutiveScaleInCount = "tikv.tidb.pingcap.com/consecutive-scale-in-count" // AnnAutoScalingTargetName describes the target TidbCluster Ref Name for the TidbCluserAutoScaler AnnAutoScalingTargetName = "auto-scaling.tidb.pingcap.com/target-name" // AnnAutoScalingTargetNamespace describes the target TidbCluster Ref Namespace for the TidbCluserAutoScaler AnnAutoScalingTargetNamespace = "auto-scaling.tidb.pingcap.com/target-namespace" // AnnTiKVAutoScalingOutOrdinals describe the tikv pods' ordinal list which is created by auto-scaling out AnnTiKVAutoScalingOutOrdinals = "tikv.tidb.pingcap.com/scale-out-ordinals" // AnnTiDBAutoScalingOutOrdinals describe the tidb pods' ordinal list which is created by auto-scaling out AnnTiDBAutoScalingOutOrdinals = "tidb.tidb.pingcap.com/scale-out-ordinals" // AnnSkipTLSWhenConnectTiDB describes whether skip TLS when connecting to TiDB Server AnnSkipTLSWhenConnectTiDB = "tidb.tidb.pingcap.com/skip-tls-when-connect-tidb" // PDLabelVal is PD label value PDLabelVal string = "pd" // TiDBLabelVal is TiDB label value TiDBLabelVal string = "tidb" // TiKVLabelVal is TiKV label value TiKVLabelVal string = "tikv" // TiFlashLabelVal is TiKV label value TiFlashLabelVal string = "tiflash" // PumpLabelVal is Pump label value PumpLabelVal string = "pump" // DiscoveryLabelVal is Discovery label value DiscoveryLabelVal string = "discovery" // TiDBMonitorVal is Monitor label value TiDBMonitorVal string = "monitor" // CleanJobLabelVal is clean job label value CleanJobLabelVal string = "clean" // RestoreJobLabelVal is restore job label value RestoreJobLabelVal string = "restore" // BackupJobLabelVal is backup job label value BackupJobLabelVal string = "backup" // BackupScheduleJobLabelVal is backup schedule job label value BackupScheduleJobLabelVal string = "backup-schedule" // InitJobLabelVal is TiDB initializer job label value InitJobLabelVal string = "initializer" // TiDBOperator is ManagedByLabelKey label value TiDBOperator string = "tidb-operator" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Label ¶
Label is the label field in metadata
func NewBackup ¶ added in v1.1.0
func NewBackup() Label
NewBackup initialize a new Label for Jobs of bakcup
func NewBackupSchedule ¶ added in v1.1.0
func NewBackupSchedule() Label
NewBackupSchedule initialize a new Label for backups of bakcup schedule
func NewInitializer ¶ added in v1.1.0
func NewInitializer() Label
NewInitializer initialize a new Label for Jobs of TiDB initializer
func NewMonitor ¶ added in v1.1.0
func NewMonitor() Label
func NewRestore ¶ added in v1.1.0
func NewRestore() Label
NewRestore initialize a new Label for Jobs of restore
func (Label) BackupSchedule ¶ added in v1.1.0
BackupSchedule assigns specific value to backup schedule key in label
func (Label) ComponentType ¶ added in v0.2.0
ComponentType returns component type
func (Label) Initializer ¶ added in v1.1.0
Initializer assigns specific value to initializer key in label
func (Label) IsManagedByTiDBOperator ¶ added in v1.1.0
IsManagedByTiDBOperator returns whether label is a Managed by tidb-operator
func (Label) LabelSelector ¶
func (l Label) LabelSelector() *metav1.LabelSelector
LabelSelector gets LabelSelector from label
func (Label) RestoreJob ¶ added in v1.1.0
RestoreJob assigns restore to component key in label
Click to show internal directories.
Click to hide internal directories.