-
Notifications
You must be signed in to change notification settings - Fork 502
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
dm-operator/: support start a new dm cluster with dm-masters and dm-workers #3146
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3146 +/- ##
==========================================
- Coverage 43.66% 40.69% -2.98%
==========================================
Files 159 167 +8
Lines 17101 18365 +1264
==========================================
+ Hits 7467 7473 +6
- Misses 8985 10244 +1259
+ Partials 649 648 -1
Flags with carried forward coverage won't be shown. Click here to find out more. |
…o supportStartDMCluster
…o supportStartDMCluster
if version == nil { | ||
version = &dc.Spec.Version | ||
} | ||
image = fmt.Sprintf("%s:%s", baseImage, *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.
What if *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.
Use "latest" in 161b862
// - upgrade the dm-master cluster | ||
// - scale out/in the dm-master cluster | ||
// - failover the dm-master cluster | ||
if err := dcc.masterMemberManager.Sync(dc); err != nil { |
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.
manifests/dm/dm-cluster.yaml
Outdated
version: v2.0.0-beta.2 | ||
pvReclaimPolicy: Delete | ||
discovery: | ||
address: "http://basic-discovery.demo.svc:10261" |
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.
Why we need to config the discovery address?
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.
Because dmcluster won't start another discovery service for itself. It will just reuse tidb cluster's discovery address.
if !dc.MasterIsAvailable() { | ||
return controller.RequeueErrorf("DMCluster: %s/%s, waiting for dm-master cluster running", ns, dcName) | ||
} |
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 think it's OK to remove this check if dm-worker can handle the case where dm-master service is unavailable.
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 dm-master doesn't have more than replicas/2 members alive, it can't offer service. I think we can keep it?
When adding logic about the upgrade, scale, and failover, please consider the case in #2886. |
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.
Rest 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
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
/test pull-e2e-kind |
What problem does this PR solve?
#2868
What is changed and how does it work?
Support deploying dm cluster with masters and workers.
Check List
Tests
Deploy dm-cluster with
manifests/dm/dm-cluster.yaml
:kubectl get pods
, dm-master and dm-worker pods start correctlykubectl get dc
, can return dm-cluster info correctlykubectl port-forward svc/basic-dm-master
, can forward dm-master service correctly.kubectl describe dc basic
:Code changes
Does this PR introduce a user-facing change?: