label

package
v1.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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
	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"

	// 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"

	// 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"
	// AnnStsLastSyncTimestamp 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"
	// 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"
	// 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"

	// 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 TiFlash label value
	TiFlashLabelVal string = "tiflash"
	// TiCDCLabelVal is TiCDC label value
	TiCDCLabelVal string = "ticdc"
	// 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"

	// DMMasterLabelVal is dm-master label value
	DMMasterLabelVal string = "dm-master"
	// DMWorkerLabelVal is dm-worker label value
	DMWorkerLabelVal string = "dm-worker"

	// 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

This section is empty.

Types

type Label

type Label map[string]string

Label is the label field in metadata

func New

func New() Label

New initialize a new Label for components of tidb cluster

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 NewDM added in v1.2.0

func NewDM() Label

NewDM initialize a new Label for components of dm cluster

func NewGroup added in v1.2.0

func NewGroup() Label

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 NewOperatorManaged added in v1.2.0

func NewOperatorManaged() Label

func NewRestore added in v1.1.0

func NewRestore() Label

NewRestore initialize a new Label for Jobs of restore

func (Label) Application added in v1.2.4

func (l Label) Application(name string) Label

Application adds application kv pair to label

func (Label) Backup added in v1.1.0

func (l Label) Backup(val string) Label

Backup assigns specific value to backup key in label

func (Label) BackupJob added in v1.1.0

func (l Label) BackupJob() Label

BackupJob assigns backup to component key in label

func (Label) BackupSchedule added in v1.1.0

func (l Label) BackupSchedule(val string) Label

BackupSchedule assigns specific value to backup schedule key in label

func (Label) CleanJob added in v1.1.0

func (l Label) CleanJob() Label

CleanJob assigns clean to component key in label

func (Label) Component added in v0.2.0

func (l Label) Component(name string) Label

Component adds component kv pair to label

func (Label) ComponentType added in v0.2.0

func (l Label) ComponentType() string

ComponentType returns component type

func (Label) Copy added in v1.1.1

func (l Label) Copy() Label

Copy copy the value of label to avoid pointer copy

func (Label) DMMaster added in v1.2.0

func (l Label) DMMaster() Label

DMMaster assigns dm-master to component key in label

func (Label) DMWorker added in v1.2.0

func (l Label) DMWorker() Label

DMWorker assigns dm-worker to component key in label

func (Label) Discovery added in v1.1.0

func (l Label) Discovery() Label

Discovery assigns discovery to component key in label

func (Label) Grafana added in v1.2.4

func (l Label) Grafana() Label

Grafana assigns grafana to app key in the label

func (Label) Initializer added in v1.1.0

func (l Label) Initializer(val string) Label

Initializer assigns specific value to initializer key in label

func (Label) Instance added in v0.4.0

func (l Label) Instance(name string) Label

Instance adds instance kv pair to label

func (Label) IsDMMaster added in v1.2.0

func (l Label) IsDMMaster() bool

IsDMMaster returns whether label is a DMMaster component

func (Label) IsDMWorker added in v1.2.0

func (l Label) IsDMWorker() bool

IsDMWorker returns whether label is a DMWorker component

func (Label) IsManagedByTiDBOperator added in v1.1.0

func (l Label) IsManagedByTiDBOperator() bool

IsManagedByTiDBOperator returns whether label is a Managed by tidb-operator

func (Label) IsMonitor

func (l Label) IsMonitor() bool

IsMonitor returns whether label is a Monitor component

func (Label) IsPD

func (l Label) IsPD() bool

IsPD returns whether label is a PD component

func (Label) IsPump added in v1.1.1

func (l Label) IsPump() bool

IsPump returns whether label is a Pump component

func (Label) IsTiCDC added in v1.1.0

func (l Label) IsTiCDC() bool

IsTiCDC returns whether label is a TiCDC component

func (Label) IsTiDB

func (l Label) IsTiDB() bool

IsTiDB returns whether label is a TiDB component

func (Label) IsTiFlash added in v1.1.0

func (l Label) IsTiFlash() bool

IsTiFlash returns whether label is a TiFlash component

func (Label) IsTiKV

func (l Label) IsTiKV() bool

IsTiKV returns whether label is a TiKV component

func (Label) IsTidbClusterPod added in v1.2.0

func (l Label) IsTidbClusterPod() bool

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) Labels

func (l Label) Labels() map[string]string

Labels converts label to map[string]string

func (Label) Monitor

func (l Label) Monitor() Label

Monitor assigns monitor to component key in label

func (Label) Namespace

func (l Label) Namespace(name string) Label

Namespace adds namespace kv pair to label

func (Label) PD

func (l Label) PD() Label

PD assigns pd to component key in label

func (Label) Prometheus added in v1.2.4

func (l Label) Prometheus() Label

Prometheus assigns prometheus to app key in the label

func (Label) Pump added in v1.1.0

func (l Label) Pump() Label

Pump assigns pump to component key in label

func (Label) Restore added in v1.1.0

func (l Label) Restore(val string) Label

Restore assigns specific value to restore key in label

func (Label) RestoreJob added in v1.1.0

func (l Label) RestoreJob() Label

RestoreJob assigns restore to component key in label

func (Label) Selector

func (l Label) Selector() (labels.Selector, error)

Selector gets labels.Selector from label

func (Label) String added in v1.0.0

func (l Label) String() string

String converts label to a string

func (Label) TiCDC added in v1.1.0

func (l Label) TiCDC() Label

TiCDC assigns ticdc to component key in label

func (Label) TiDB

func (l Label) TiDB() Label

TiDB assigns tidb to component key in label

func (Label) TiFlash added in v1.1.0

func (l Label) TiFlash() Label

TiFlash assigns tiflash to component key in label

func (Label) TiKV

func (l Label) TiKV() Label

TiKV assigns tikv to component key in label

func (Label) UsedBy added in v1.1.1

func (l Label) UsedBy(name string) Label

UserBy adds use-by kv pair to label

func (Label) UsedByEndUser added in v1.1.1

func (l Label) UsedByEndUser() Label

UsedByEndUser adds use-by=end-user label

func (Label) UsedByPeer added in v1.1.1

func (l Label) UsedByPeer() Label

UsedByPeer adds used-by=peer label

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL