-
Notifications
You must be signed in to change notification settings - Fork 499
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
sync pump cluster in new pump_member_manager #1269
Conversation
Signed-off-by: Aylei <rayingecho@gmail.com>
/run-e2e-test |
@@ -28,7 +28,7 @@ rules: | |||
- events | |||
verbs: ["*"] | |||
- apiGroups: [""] | |||
resources: ["endpoints"] | |||
resources: ["endpoints","configmaps"] |
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.
To operate configmaps of pump
@@ -95,7 +95,7 @@ spec: | |||
- -v=4 | |||
# TODO webhook is not bundled with tidb-operator yet and tested in | |||
# e2e only, make it configurable in helm chart | |||
- -features=AdvancedStatefulSet=true | |||
# - -features=AdvancedStatefulSet=true |
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.
Disable asts temporarily, a new [Serial]
tag will address this #1257
} | ||
|
||
// syncStatefulSet syncs the pump statefulset | ||
// TODO: sync statefulset status of pump to tidbcluster |
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.
|
||
oldCmTemp, err := pmm.cmLister.ConfigMaps(newCm.Namespace).Get(newCm.Name) | ||
if errors.IsNotFound(err) { | ||
// TODO: garbage collection for pump configmaps |
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.
} | ||
if spec.HostNetwork() { | ||
// For backward compatibility, set HOSTNAME to POD_NAME in hostNetwork mode | ||
envs = append(envs, corev1.EnvVar{ |
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 can avoid rolling-update when user upgrade from helm chart, but I'm not sure if there is any side-effect, @cofyc PTAL
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.
you don't do this because this is a new sts to deploy (no need to keep back-compatibility like pd/tikv sts)
you can always use POD_NAME
for both pod network and host network mode because sts member address is always <pod-name>
.
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.
See the comment below, we have to consider the helm chart.
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.
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.
What about adding a feature gate for adopting helm managed resources?
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.
No gate is needed, if user leave the .spec.pump
as nil, the helm resource will not be adopted. The real concern is that whether user has the ability to adopt pump cluster and do not trigger rolling-update. If not, abandon helm for existing cluster will require extra effort.
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.
adapt old pump clusters and do not trigger rolling-update when update tidb-operator is reasonable for the user.
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.
adapt old pump clusters and do not trigger rolling-update when update tidb-operator is reasonable for the user.
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.
So users can allow the adoption when they need to update pump clusters? If so, then it's reasonable and we can document about this.
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.
OK, if both approaches make sense, I pretend to keep it as is to avoid additional code change (mainly in e2e, there is a case to verify the sts do not get rolling-update after adoption, which need to be re-written if we choose to change the podTemplate in this PR), further improvement on the PodTemplate
of pump could be made through other enhancement issues.
func getPumpStartScript(tc *v1alpha1.TidbCluster) (string, error) { | ||
buff := new(bytes.Buffer) | ||
// Keep the logic same as helm chart, but pump has not supported tls yet (no cert mounted) | ||
// TODO: support tls |
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.
TLS of pump is not actually supported in tidb-cluster helm chart, nor in controller. We may document this limitation first @AstroProfundis PTAL
/run-e2e-in-kind |
/run-e2e-test |
/pump \ | ||
-pd-urls={{ .Scheme }}://{{ .ClusterName }}-pd:2379 \ | ||
-L={{ .LogLevel }} \ | ||
-advertise-addr=` + "`" + `echo ${HOSTNAME}` + "`" + `.{{ .ClusterName }}-pump:8250 \ |
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 is strange, does this work? -advertise-addr={{.PodName}}.{{ .ClusterName }}-pump:8250
we don't need to pass HOSTNAME environment for sts pod, because the pod address is predictable
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.
Use the HOSTNAME
environment deliberately to keep backward compatibility with the helm chart, otherwise the pump statefulset will get rolling-update if we set the new env var POD_NAME
.
Co-Authored-By: Tennix <tennix@users.noreply.github.com>
Signed-off-by: Aylei <rayingecho@gmail.com>
/run-e2e-test |
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
/run-e2e-test |
Signed-off-by: Aylei rayingecho@gmail.com
close #1191
Note:
TidbCluster
CR docs-cn#2092Check List
Tests
Code changes
Related changes
Does this PR introduce a user-facing change?:
@weekface @tennix @cofyc @Yisaer @AstroProfundis PTAL