Documentation ¶
Index ¶
- Constants
- func AnnoKeyOfConfigMapNameForNewSTS(compType string) string
- func PDMSLabel(name string) string
- type Label
- func New() Label
- func NewBackup() Label
- func NewBackupSchedule() Label
- func NewBackupScheduleGroup(val string) Label
- func NewDM() Label
- func NewGroup() Label
- func NewInitializer() Label
- func NewMonitor() Label
- func NewOperatorManaged() Label
- func NewRestore() Label
- func NewTiDBDashboard() Label
- func NewTiDBNGMonitoring() Label
- func (l Label) Application(name string) 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) Copy() Label
- func (l Label) DMMaster() Label
- func (l Label) DMWorker() Label
- func (l Label) Discovery() Label
- func (l Label) Grafana() Label
- func (l Label) Initializer(val string) Label
- func (l Label) Instance(name string) Label
- func (l Label) IsDMMaster() bool
- func (l Label) IsDMWorker() bool
- func (l Label) IsManagedByTiDBOperator() bool
- func (l Label) IsMonitor() bool
- func (l Label) IsNGMonitoring() bool
- func (l Label) IsPD() bool
- func (l Label) IsPump() bool
- func (l Label) IsTiCDC() bool
- func (l Label) IsTiDB() bool
- func (l Label) IsTiFlash() bool
- func (l Label) IsTiKV() bool
- func (l Label) IsTiProxy() bool
- func (l Label) IsTidbClusterPod() bool
- func (l Label) LabelSelector() *metav1.LabelSelector
- func (l Label) Labels() map[string]string
- func (l Label) Monitor() Label
- func (l Label) NGMonitoring() Label
- func (l Label) Namespace(name string) Label
- func (l Label) PD() Label
- func (l Label) PDMS(name string) Label
- func (l Label) Prometheus() Label
- func (l Label) Pump() Label
- func (l Label) Restore(val string) Label
- func (l Label) RestoreJob() Label
- func (l Label) RestoreWarmUpJob() Label
- func (l Label) Selector() (labels.Selector, error)
- func (l Label) String() string
- func (l Label) TiCDC() Label
- func (l Label) TiDB() Label
- func (l Label) TiDBDashboard() Label
- func (l Label) TiFlash() Label
- func (l Label) TiKV() Label
- func (l Label) TiProxy() Label
- func (l Label) UsedBy(name string) Label
- func (l Label) UsedByEndUser() Label
- func (l Label) UsedByPeer() Label
Constants ¶
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 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" // UsedByLabelKey indicate where it is used. for example, tidb has two services, // one for internal component access and the other for end-user UsedByLabelKey string = "app.kubernetes.io/used-by" // 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" // BackupScheduleGroupLabelKey is backup schedule group key BackupScheduleGroupLabelKey string = "tidb.pingcap.com/backup-schedule-group" // BackupLabelKey is backup key BackupLabelKey string = "tidb.pingcap.com/backup" // RestoreLabelKey is restore key RestoreLabelKey string = "tidb.pingcap.com/restore" // RestoreWarmUpLabelKey defines which pod the restore warms up RestoreWarmUpLabelKey string = "tidb.pingcap.com/warm-up-pod" // BackupProtectionFinalizer is the name of finalizer on backups or federation backups BackupProtectionFinalizer string = "tidb.pingcap.com/backup-protection" // VolumeRestoreFederationFinalizer is the name of finalizer on federation restores VolumeRestoreFederationFinalizer string = "tidb.pingcap.com/restore-protection" // AutoScalingGroupLabelKey describes the autoscaling group of the TiDB AutoScalingGroupLabelKey = "tidb.pingcap.com/autoscaling-group" // AutoInstanceLabelKey is label key used in autoscaling, it represents the autoscaler name AutoInstanceLabelKey string = "tidb.pingcap.com/auto-instance" // AutoComponentLabelKey is label key used in autoscaling, it represents which component is auto scaled AutoComponentLabelKey string = "tidb.pingcap.com/auto-component" // BaseTCLabelKey is label key used for heterogeneous clusters to refer to its base TidbCluster BaseTCLabelKey string = "tidb.pingcap.com/base-tc" // AnnHATopologyKey defines the High availability topology key AnnHATopologyKey = "pingcap.com/ha-topology-key" // 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" // AnnTiCDCGracefulShutdownBeginTime is pod annotation key to indicate the begin time for graceful shutdown TiCDC AnnTiCDCGracefulShutdownBeginTime = "tidb.pingcap.com/ticdc-graceful-shutdown-begin-time" // AnnStsLastSyncTimestamp is sts annotation key to indicate the last timestamp the operator sync the sts AnnStsLastSyncTimestamp = "tidb.pingcap.com/sync-timestamp" // AnnTiflashMountCMInTiflashContainer is tiflash pod annotation key to indicate whether directly mount ConfigMap // in tiflash container instead of init container for tiflash. With it annotated, the tiflash container will directly // read config from files mounted by ConfigMap and that enables tiflash support hot-reload config. AnnTiflashMountCMInTiflashContainer = "tiflash.tidb.pingcap.com/mount-cm-in-tiflash-container" // AnnoPrefixConfigMapNameBeforeDelete is the last used ConfigMap name before STS deleted. xxx_member_manager should use its // annotation value as ConfigMap name if the value is not empty when it tries to CREATE or RESTORE sts. AnnoPrefixConfigMapNameBeforeDelete = "tidb.pingcap.com/configmap-name-before-delete-" // AnnoOwnerGeneration store the generation of owner, for example, save generation of TC into tikv STS's annotation. // It's useful for scenario where you need to know whether the STS is already updated with the latest TC.spec.{component}. // Though the number of owner of object may more than one, but in our scenario, it's only one. AnnoOwnerGeneration = "tidb.pingcap.com/owner-generation" // AnnPVCScaleInTime is pvc scaled in time key used in PVC for e2e test only AnnPVCScaleInTime = "tidb.pingcap.com/scale-in-time" // 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" // AnnTSODeleteSlots is annotation key of pd ms tso delete slots. AnnTSODeleteSlots = "tso.tidb.pingcap.com/delete-slots" // AnnSchedulingDeleteSlots is annotation key of pd ms scheduling delete slots. AnnSchedulingDeleteSlots = "scheduling.tidb.pingcap.com/delete-slots" // AnnTiDBDeleteSlots is annotation key of tidb delete slots. AnnTiDBDeleteSlots = "tidb.tidb.pingcap.com/delete-slots" // AnnTiKVDeleteSlots is annotation key of tikv delete slots. AnnTiKVDeleteSlots = "tikv.tidb.pingcap.com/delete-slots" // AnnTiFlashDeleteSlots is annotation key of tiflash delete slots. AnnTiFlashDeleteSlots = "tiflash.tidb.pingcap.com/delete-slots" // AnnTiCDCDeleteSlots is annotation key of ticdc delete slots. AnnTiCDCDeleteSlots = "ticdc.tidb.pingcap.com/delete-slots" // AnnTiProxyDeleteSlots is annotation key of tiproxy delete slots. AnnTiProxyDeleteSlots = "tiproxy.tidb.pingcap.com/delete-slots" // AnnDMMasterDeleteSlots is annotation key of dm-master delete slots. AnnDMMasterDeleteSlots = "dm-master.tidb.pingcap.com/delete-slots" // AnnDMWorkerDeleteSlots is annotation key of dm-worker delete slots. AnnDMWorkerDeleteSlots = "dm-worker.tidb.pingcap.com/delete-slots" // AnnSkipTLSWhenConnectTiDB describes whether skip TLS when connecting to TiDB Server AnnSkipTLSWhenConnectTiDB = "tidb.tidb.pingcap.com/skip-tls-when-connect-tidb" // AnnBackupCloudSnapKey is the annotation key for backup metadata based cloud snapshot AnnBackupCloudSnapKey string = "tidb.pingcap.com/backup-cloud-snapshot" // AnnTiKVVolumesReadyKey is the annotation key to indicate whether the TiKV volumes are ready. // TiKV member manager will wait until the TiKV volumes are ready before starting the TiKV pod // when TiDB cluster is restored from volume snapshot based backup. AnnTiKVVolumesReadyKey = "tidb.pingcap.com/tikv-volumes-ready" // AnnoTiFlash710KeepPortsKey is the annotation key to indicate whether the TiFlash v7.1.0+ keeps ports to avoid restart. // ports: tcp_port, http_port, tcp_port_secure and https_port. // NOTE: this annotation should only be used for existing TiFlash v7.1.0+ clusters with ports config items. AnnoTiFlash710KeepPortsKey = "tidb.pingcap.com/tiflash-710-keep-ports" // AnnTiKVNoActiveStoreSince is the annotation key to indicate the time since a pod does not have a valid store // Listed from store status, but has a store id in label. This is an alternate way to detect tombstone stores. AnnTiKVNoActiveStoreSince = "tidb.pingcap.com/tikv-no-active-store-since" // PDLabelVal is PD label value PDLabelVal string = "pd" // PDMSTSOLabelVal is pd microservice tso member type PDMSTSOLabelVal string = "tso" // PDMSSchedulingLabelVal is pd microservice scheduling member type PDMSSchedulingLabelVal string = "scheduling" // TiDBLabelVal is TiDB label value TiDBLabelVal string = "tidb" // TiKVLabelVal is TiKV label value TiKVLabelVal string = "tikv" // TiFlashLabelVal is TiFlash label value TiFlashLabelVal string = "tiflash" // TiCDCLabelVal is TiCDC label value TiCDCLabelVal string = "ticdc" // TiProxyLabelVal is TiProxy label value TiProxyLabelVal string = "tiproxy" // 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" // RestoreWarmUpJobLabelVal is restore warmup job label value RestoreWarmUpJobLabelVal string = "warmup" // 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" // DMMasterLabelVal is dm-master label value DMMasterLabelVal string = "dm-master" // DMWorkerLabelVal is dm-worker label value DMWorkerLabelVal string = "dm-worker" // NGMonitorLabelVal is ng-monitoring label value NGMonitorLabelVal string = "ng-monitoring" // TiDBDashboardLabelVal is tidb-dashboard label value TiDBDashboardLabelVal string = "tidb-dashboard" // PrometheusVal is Prometheus label value PrometheusVal string = "prometheus" // GrafanaVal is Grafana label value GrafanaVal string = "grafana" // ApplicationLabelKey is App label key ApplicationLabelKey string = "app.kubernetes.io/app" )
Variables ¶
This section is empty.
Functions ¶
func AnnoKeyOfConfigMapNameForNewSTS ¶ added in v1.5.3
Types ¶
type Label ¶
Label is the label field in metadata
func NewBackupSchedule ¶
func NewBackupSchedule() Label
NewBackupSchedule initialize a new Label for backups of backup schedule
func NewBackupScheduleGroup ¶ added in v1.5.4
func NewInitializer ¶
func NewInitializer() Label
NewInitializer initialize a new Label for Jobs of TiDB initializer
func NewMonitor ¶
func NewMonitor() Label
func NewOperatorManaged ¶
func NewOperatorManaged() Label
func NewTiDBDashboard ¶ added in v1.4.0
func NewTiDBDashboard() Label
func NewTiDBNGMonitoring ¶
func NewTiDBNGMonitoring() Label
func (Label) Application ¶
Application adds application kv pair to label
func (Label) BackupSchedule ¶
BackupSchedule assigns specific value to backup schedule key in label
func (Label) ComponentType ¶
ComponentType returns component type
func (Label) Initializer ¶
Initializer assigns specific value to initializer key in label
func (Label) IsDMMaster ¶
IsDMMaster returns whether label is a DMMaster component
func (Label) IsDMWorker ¶
IsDMWorker returns whether label is a DMWorker component
func (Label) IsManagedByTiDBOperator ¶
IsManagedByTiDBOperator returns whether label is a Managed by tidb-operator
func (Label) IsNGMonitoring ¶
IsNGMonitoring returns whether label is a NGMonitoring component
func (Label) IsTidbClusterPod ¶
IsTidbClusterPod returns whether it is a TidbCluster-controlled pod
func (Label) LabelSelector ¶
func (l Label) LabelSelector() *metav1.LabelSelector
LabelSelector gets LabelSelector from label
func (Label) NGMonitoring ¶
NGMonitoring assigns ng monitoring to component key in label
func (Label) Prometheus ¶
Prometheus assigns prometheus to app key in the label
func (Label) RestoreJob ¶
RestoreJob assigns restore to component key in label
func (Label) RestoreWarmUpJob ¶ added in v1.5.1
func (Label) TiDBDashboard ¶ added in v1.4.0
TiDBDashboard assigns tidb dashboard to component key in label
func (Label) UsedByEndUser ¶
UsedByEndUser adds use-by=end-user label