Skip to content

Commit bf59b48

Browse files
authored
feat(scheduling): rename scheduler to scheduling (#6503)
1 parent 89eeb44 commit bf59b48

64 files changed

Lines changed: 20663 additions & 128 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/core/v1alpha1/common_types.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,11 @@ const (
132132
LabelValComponentTiFlash = string(meta.ComponentTiFlash)
133133
LabelValComponentTiCDC = string(meta.ComponentTiCDC)
134134
LabelValComponentTSO = string(meta.ComponentTSO)
135-
LabelValComponentScheduler = string(meta.ComponentScheduler)
135+
LabelValComponentScheduling = string(meta.ComponentScheduling)
136136
LabelValComponentTiProxy = string(meta.ComponentTiProxy)
137137
LabelValComponentReplicationWorker = string(meta.ComponentReplicationWorker)
138+
// Deprecated: use LabelValComponentScheduling
139+
LabelValComponentScheduler = string(meta.ComponentScheduler)
138140

139141
// LabelKeyClusterID is the unique identifier of the cluster.
140142
// This label is used for backward compatibility with TiDB Operator v1, so it has a different prefix.

api/core/v1alpha1/names.go

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ const (
6060
ContainerNameTiFlash = "tiflash"
6161
ContainerNameTiCDC = "ticdc"
6262
ContainerNameTSO = "tso"
63-
ContainerNameScheduler = "scheduler"
63+
ContainerNameScheduling = "scheduling"
6464
ContainerNameTiProxy = "tiproxy"
6565
ContainerNameReplicationWorker = "repl-worker"
66+
// Deprecated: use ContainerNameScheduling
67+
ContainerNameScheduler = "scheduler"
6668

6769
// An init container to copy pre stop checker cmd to main container
6870
ContainerNamePrestopChecker = meta.NamePrefix + "prestop-checker"
@@ -89,9 +91,11 @@ const (
8991
DirPathConfigTiFlash = "/etc/tiflash"
9092
DirPathConfigTiCDC = "/etc/ticdc"
9193
DirPathConfigTSO = "/etc/tso"
92-
DirPathConfigScheduler = "/etc/scheduler"
94+
DirPathConfigScheduling = "/etc/scheduling"
9395
DirPathConfigTiProxy = "/etc/tiproxy"
9496
DirPathConfigReplicationWorker = "/etc/replication-worker"
97+
// Deprecated: use DirPathConfigScheduling
98+
DirPathConfigScheduler = "/etc/scheduler"
9599

96100
// DirPathPrestop defines dir path of pre stop checker cmd
97101
DirPathPrestop = "/prestop"
@@ -107,15 +111,17 @@ const (
107111
// TLS
108112
//
109113
// Dir path of cluster tls file
110-
DirPathClusterTLSPD = "/var/lib/pd-tls"
111-
DirPathClusterTLSTiKV = "/var/lib/tikv-tls"
112-
DirPathClusterTLSTiDB = "/var/lib/tidb-tls"
113-
DirPathClusterTLSTiFlash = "/var/lib/tiflash-tls"
114-
DirPathClusterClientTLS = "/var/lib/cluster-client-tls"
115-
DirPathClusterTLSTiCDC = "/var/lib/ticdc-tls"
116-
DirPathClusterTLSTSO = "/var/lib/tso-tls"
114+
DirPathClusterTLSPD = "/var/lib/pd-tls"
115+
DirPathClusterTLSTiKV = "/var/lib/tikv-tls"
116+
DirPathClusterTLSTiDB = "/var/lib/tidb-tls"
117+
DirPathClusterTLSTiFlash = "/var/lib/tiflash-tls"
118+
DirPathClusterClientTLS = "/var/lib/cluster-client-tls"
119+
DirPathClusterTLSTiCDC = "/var/lib/ticdc-tls"
120+
DirPathClusterTLSTSO = "/var/lib/tso-tls"
121+
DirPathClusterTLSScheduling = "/var/lib/scheduling-tls"
122+
DirPathClusterTLSTiProxy = "/var/lib/tiproxy-tls"
123+
// Deprecated: use DirPathClusterTLSScheduling
117124
DirPathClusterTLSScheduler = "/var/lib/scheduler-tls"
118-
DirPathClusterTLSTiProxy = "/var/lib/tiproxy-tls"
119125

120126
// DirPathMySQLTLS is the dir path of tls file for tidb and mysql client
121127
DirPathMySQLTLS = "/var/lib/tidb-sql-tls"

api/core/v1alpha1/pd_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ type PDMode string
188188
const (
189189
// Normal mode of PD, all services are provided by a single component
190190
PDModeNormal = ""
191-
// Micro Service Mode of PD, some services(TSO,Scheduler) are separated from PD
191+
// Micro Service Mode of PD, some services(TSO,Scheduling) are separated from PD
192192
// See https://docs.pingcap.com/tidb/stable/pd-microservices/
193193
PDModeMS = "ms"
194194
)

api/core/v1alpha1/scheduler_types.go

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,17 @@ import (
2121
)
2222

2323
const (
24-
SchedulerPortNameClient = "client"
24+
// Deprecated: use SchedulingPortNameClient
25+
SchedulerPortNameClient = "client"
26+
// Deprecated: use DefaultSchedulingPortClient
2527
DefaultSchedulerPortClient = 3379
2628
)
2729

2830
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
2931
// +kubebuilder:object:root=true
3032

3133
// SchedulerGroupList defines a list of Scheduler groups
34+
// Deprecated: use SchedulingGroupList
3235
type SchedulerGroupList struct {
3336
metav1.TypeMeta `json:",inline"`
3437
metav1.ListMeta `json:"metadata,omitempty"`
@@ -40,7 +43,7 @@ type SchedulerGroupList struct {
4043
// +kubebuilder:object:root=true
4144
// +kubebuilder:subresource:status
4245
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector
43-
// +kubebuilder:resource:categories=group,shortName=sg
46+
// +kubebuilder:resource:categories=group,shortName=schg
4447
// +kubebuilder:selectablefield:JSONPath=`.spec.cluster.name`
4548
// +kubebuilder:printcolumn:name="Cluster",type=string,JSONPath=`.spec.cluster.name`
4649
// +kubebuilder:printcolumn:name="Desired",type=string,JSONPath=`.spec.replicas`
@@ -51,8 +54,10 @@ type SchedulerGroupList struct {
5154
// +kubebuilder:printcolumn:name="Synced",type=string,JSONPath=`.status.conditions[?(@.type=="Synced")].status`
5255
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`
5356
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
57+
// +kubebuilder:deprecatedversion:warning="This type is deprecated, use SchedulingGroup instead"
5458

5559
// SchedulerGroup defines a group of similar Scheduler instances
60+
// Deprecated: use SchedulingGroup
5661
// +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 40",message="name must not exceed 40 characters"
5762
type SchedulerGroup struct {
5863
metav1.TypeMeta `json:",inline"`
@@ -66,6 +71,7 @@ type SchedulerGroup struct {
6671
// +kubebuilder:object:root=true
6772

6873
// SchedulerList defines a list of Scheduler instances
74+
// Deprecated: use SchedulingList
6975
type SchedulerList struct {
7076
metav1.TypeMeta `json:",inline"`
7177
metav1.ListMeta `json:"metadata,omitempty"`
@@ -82,8 +88,10 @@ type SchedulerList struct {
8288
// +kubebuilder:printcolumn:name="Synced",type=string,JSONPath=`.status.conditions[?(@.type=="Synced")].status`
8389
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`
8490
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
91+
// +kubebuilder:deprecatedversion:warning="This is deprecated, use Scheduling instead"
8592

8693
// Scheduler defines a Scheduler instance
94+
// Deprecated: use Scheduling
8795
// +kubebuilder:validation:XValidation:rule="size(self.metadata.name) <= 47",message="name must not exceed 47 characters"
8896
type Scheduler struct {
8997
metav1.TypeMeta `json:",inline"`
@@ -94,6 +102,7 @@ type Scheduler struct {
94102
}
95103

96104
// SchedulerGroupSpec describes the common attributes of a SchedulerGroup
105+
// Deprecated: use SchedulingGroupSpec
97106
type SchedulerGroupSpec struct {
98107
Cluster ClusterReference `json:"cluster"`
99108
// Features are enabled feature
@@ -109,21 +118,23 @@ type SchedulerGroupSpec struct {
109118
Template SchedulerTemplate `json:"template"`
110119
}
111120

121+
// SchedulerTemplate defines template of Scheduler
122+
// Deprecated: use SchedulingTemplate
112123
type SchedulerTemplate struct {
113124
ObjectMeta `json:"metadata,omitempty"`
114125
Spec SchedulerTemplateSpec `json:"spec"`
115126
}
116127

117128
// SchedulerTemplateSpec can only be specified in SchedulerGroup
118-
// TODO: It's name may need to be changed to distinguish from PodTemplateSpec
129+
// Deprecated: use SchedulingTemplateSpec
119130
// +kubebuilder:validation:XValidation:rule="!has(self.overlay) || !has(self.overlay.volumeClaims) || (has(self.volumes) && self.overlay.volumeClaims.all(vc, vc.name in self.volumes.map(v, v.name)))",message="overlay volumeClaims names must exist in volumes"
120131
type SchedulerTemplateSpec struct {
121132
// Version must be a semantic version.
122133
// It can has a v prefix or not.
123134
// +kubebuilder:validation:Pattern=`^(v)?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
124135
Version string `json:"version"`
125136

126-
// Image is pd's image
137+
// Image is scheduler's image
127138
// If tag is omitted, version will be used as the image tag.
128139
// Default is pingcap/pd
129140
Image *string `json:"image,omitempty"`
@@ -136,7 +147,7 @@ type SchedulerTemplateSpec struct {
136147
UpdateStrategy UpdateStrategy `json:"updateStrategy,omitempty"`
137148

138149
// Config defines config file of Scheduler
139-
// See https://docs.pingcap.com/tidb/stable/Scheduler-configuration-file/
150+
// See https://docs.pingcap.com/tidb/stable/scheduling-configuration-file/
140151
Config ConfigFile `json:"config,omitempty"`
141152

142153
// Security defines security config
@@ -153,22 +164,26 @@ type SchedulerTemplateSpec struct {
153164
Overlay *Overlay `json:"overlay,omitempty"`
154165
}
155166

167+
// Deprecated: use SchedulingServer
156168
type SchedulerServer struct {
157169
// Ports defines all ports listened by Scheduler
158170
Ports SchedulerPorts `json:"ports,omitempty"`
159171
}
160172

173+
// Deprecated: use SchedulingPorts
161174
type SchedulerPorts struct {
162175
// Client defines port for Scheduler's api service
163176
Client *Port `json:"client,omitempty"`
164177
}
165178

179+
// Deprecated: use SchedulingGroupStatus
166180
type SchedulerGroupStatus struct {
167181
CommonStatus `json:",inline"`
168182
GroupStatus `json:",inline"`
169183
}
170184

171185
// SchedulerSpec describes the common attributes of a Scheduler instance
186+
// Deprecated: use SchedulingSpec
172187
// +kubebuilder:validation:XValidation:rule="(!has(oldSelf.topology) && !has(self.topology)) || (has(oldSelf.topology) && has(self.topology))",fieldPath=".topology",message="topology can only be set when creating"
173188
type SchedulerSpec struct {
174189
// Cluster is a reference of tidb cluster
@@ -191,6 +206,7 @@ type SchedulerSpec struct {
191206
SchedulerTemplateSpec `json:",inline"`
192207
}
193208

209+
// Deprecated: use SchedulingStatus
194210
type SchedulerStatus struct {
195211
CommonStatus `json:",inline"`
196212
}

0 commit comments

Comments
 (0)