-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend tidbcluster v1alpha1 to support configuration and pump #1193
Conversation
Signed-off-by: Aylei <rayingecho@gmail.com>
Signed-off-by: Aylei <rayingecho@gmail.com>
Signed-off-by: Aylei <rayingecho@gmail.com>
|
||
// +k8s:openapi-gen=false | ||
// TODO: add schema | ||
Config map[string]json.JsonObject `json:"config,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Configuration schema and validation requires kernel-side support, I leave these as future works and the first edition of controller-side configuration management will blindly mashal the config object to toml.
/run-e2e-in-kind |
Signed-off-by: Aylei <rayingecho@gmail.com>
Is it compatible with |
} | ||
image = fmt.Sprintf("%s:%s", baseImage, version) | ||
} | ||
return image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image requires a tag and baseImage cannot have a tag? Why define two images in componentSpec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version
is used as tag, effectively
For backward compatibility, we keep the image
field.
Yes, no actions required as stated in the design doc. If use specify new specs added in this PR, for example, |
TiDB TiDBSpec `json:"tidb,omitempty"` | ||
TiKV TiKVSpec `json:"tikv,omitempty"` | ||
// +k8s:openapi-gen=false | ||
TiKVPromGateway TiKVPromGatewaySpec `json:"tikvPromGateway,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field is not used anymore, removing this is backward compatible as long as the validation code do not reject this field
if baseImage != "" { | ||
version := a.ComponentSpec.Version | ||
if version == "" { | ||
version = a.ClusterSpec.Version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validation constraints will guarantee either .spec.version or .spec..version is not-empty if baseImage
is present
Timezone string `json:"timezone,omitempty"` | ||
|
||
// Whether enable PVC reclaim for orphan PVC left by statefulset scale-in | ||
EnablePVReclaim bool `json:"enablePVReclaim,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this PR, this variable name is confusing. Maybe better to rename it as AutoReclaimPV
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest PVCReclaimPolicy
with enum value Deferred
and Immediate
if we are going to do the renaming
Signed-off-by: Aylei <rayingecho@gmail.com>
/run-e2e-in-kind |
@@ -90,19 +91,64 @@ type TidbClusterList struct { | |||
// +k8s:openapi-gen=true | |||
// TidbClusterSpec describes the attributes that a user creates on a tidb cluster | |||
type TidbClusterSpec struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modification of .status
will be introduced along with the controller logic
Signed-off-by: Aylei <rayingecho@gmail.com>
/run-e2e-in-kind |
1 similar comment
/run-e2e-in-kind |
/run-e2e-in-kind |
@tennix We can remove this field and adjust the UT because it is not used anywhere, but I suggest we leaving it as is because TiDB MAY use persistent volume according to the RFC pingcap/tidb#13481, which introduce a built-in logging aggregation mechanism that requires local persistent (for a short time) log storage. |
/run-e2e-in-kind |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
OK, sounds good to me. |
the conflicts should be resolved |
Signed-off-by: Aylei <rayingecho@gmail.com>
@weekface conflicts addressed, PTAL @tennix @DanielZhangQD PTAL again & |
pp := a.ComponentSpec.ImagePullPolicy | ||
if pp == nil { | ||
pp = &a.ClusterSpec.ImagePullPolicy | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ClusterSpec.ImagePullPolicy
must not be empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there will be a defaulting through mutating-webhook and validation to ensure clusterSpec.ImagePullPolicy and component.ImagePullPolicy is not both empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it's not an issue if clusterSpec.ImagePullPolicy is empty, we just write empty pull policy in PodSpec and use the default of kubernetes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-e2e-in-kind |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-e2e-in-kind |
What problem does this PR solve?
This PR extends the TidbCluster v1alpha1 type to support the management of component configuration, service and pump.
Support cluster-level setting for components.
There is no logic change introduced.
Next step: controllers, as stated in #1121
close #1182
close #1159
Does this PR introduce a user-facing change?: