Skip to content
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

Merged
merged 40 commits into from
Aug 26, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
08a8ae4
add dmclusters CRD
lichunzhu Aug 5, 2020
5cb82ac
resolve conflicts
lichunzhu Aug 5, 2020
bcf58ea
Merge branch 'master' into defineDMSpec
lichunzhu Aug 5, 2020
55a6365
address comment
lichunzhu Aug 6, 2020
0aae8c0
Merge branch 'master' into defineDMSpec
lichunzhu Aug 6, 2020
f146be1
address comments
lichunzhu Aug 6, 2020
94c427b
Merge branch 'defineDMSpec' of https://github.com/lichunzhu/tidb-oper…
lichunzhu Aug 6, 2020
4f10a51
delete monitor ref
lichunzhu Aug 6, 2020
a020492
generate dmcluster client
lichunzhu Aug 6, 2020
3edfaa2
address comments
lichunzhu Aug 6, 2020
74aca39
Merge branch 'master' into defineDMSpec
lichunzhu Aug 7, 2020
2c1bec5
address comment
lichunzhu Aug 7, 2020
fbe26f3
tmp commit
lichunzhu Aug 7, 2020
d85a9fc
resolve conflict
lichunzhu Aug 7, 2020
a9da15f
merge master
lichunzhu Aug 11, 2020
ba0f518
remove dm package
lichunzhu Aug 12, 2020
7a51c07
fix bugs
lichunzhu Aug 12, 2020
3ec6c86
fix bug
lichunzhu Aug 12, 2020
8122c71
support start dm-master and dm-worker in cluster
lichunzhu Aug 18, 2020
a38bb0e
fix some bugs
lichunzhu Aug 19, 2020
1e7efd8
merge master branch and resolve conflicts
lichunzhu Aug 19, 2020
850035c
fix ut
lichunzhu Aug 20, 2020
cd3f5b4
fix dm-master start
lichunzhu Aug 24, 2020
f4a641d
fix dm-worker start bug
lichunzhu Aug 24, 2020
5a51cbe
Merge branch 'master' of https://github.com/pingcap/tidb-operator int…
lichunzhu Aug 25, 2020
be4fd5e
add more column info
lichunzhu Aug 25, 2020
1e4f2ac
Merge branch 'master' of https://github.com/pingcap/tidb-operator int…
lichunzhu Aug 25, 2020
daf81f7
Merge branch 'master' into supportStartDMCluster
lichunzhu Aug 25, 2020
f7c70bd
fix ut
lichunzhu Aug 25, 2020
08f4695
fix verify
lichunzhu Aug 25, 2020
e2249f9
fix verify again
lichunzhu Aug 25, 2020
161b862
address comments
lichunzhu Aug 25, 2020
35a69d3
Merge branch 'master' into supportStartDMCluster
lichunzhu Aug 25, 2020
d3da808
regenerate code
lichunzhu Aug 25, 2020
8e52fbb
address comments
lichunzhu Aug 25, 2020
cefe7b8
Merge branch 'master' into supportStartDMCluster
lichunzhu Aug 25, 2020
f1b6029
fix import cycle problem
lichunzhu Aug 26, 2020
7726669
Merge branch 'supportStartDMCluster' of https://github.com/lichunzhu/…
lichunzhu Aug 26, 2020
84a6309
fix check
lichunzhu Aug 26, 2020
5ab015d
address comments
lichunzhu Aug 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/dm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ watch kubectl -n <namespace> get pod
Explore the DM master interface:

```bash
> kubectl -n <namespace> port-forward svc/basic-dm-master 8261:8261
> dmctl --master-addr 127.0.0.1:8261 list-member
> kubectl exec -ti -n <namespace> <cluster_name>-dm-master-0 -- /bin/sh
> ./dmctl --master-addr <cluster_name>-dm-master.<namespace>:8261 list-member
lichunzhu marked this conversation as resolved.
Show resolved Hide resolved
```

## Destroy
Expand Down
3 changes: 2 additions & 1 deletion pkg/controller/dmcluster/dm_cluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ func (dcc *Controller) sync(key string) error {
if err != nil {
klog.V(4).Infof("cluster version: %s is not semantic versioning compatible", dc.MasterVersion())
} else if clusterVersionLT2 {
return fmt.Errorf("dm-operator only supports to deploy dm-2.0")
klog.Errorf("dm version %s not supported, dm-operator only supports to deploy dm-2.0", dc.MasterVersion())
lichunzhu marked this conversation as resolved.
Show resolved Hide resolved
return nil
}

return dcc.syncDMCluster(dc.DeepCopy())
Expand Down
7 changes: 2 additions & 5 deletions pkg/dmapi/master_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@ import (
"net/http"
"sync"

"github.com/pingcap/tidb-operator/pkg/controller"

"github.com/pingcap/tidb-operator/pkg/pdapi"

"github.com/pingcap/tidb-operator/pkg/util"
"k8s.io/klog"

"k8s.io/client-go/kubernetes"
"k8s.io/klog"
)

// Namespace is a newtype of a string
Expand Down Expand Up @@ -84,7 +81,7 @@ func masterClientKey(scheme string, namespace Namespace, clusterName string) str

// MasterClientURL builds the url of master client
func MasterClientURL(namespace Namespace, clusterName string, scheme string) string {
return fmt.Sprintf("%s://%s.%s:8261", scheme, controller.DMMasterMemberName(clusterName), string(namespace))
return fmt.Sprintf("%s://%s-dm-master.%s:8261", scheme, clusterName, string(namespace))
DanielZhangQD marked this conversation as resolved.
Show resolved Hide resolved
}

// FakeMasterControl implements a fake version of MasterControlInterface.
Expand Down
9 changes: 0 additions & 9 deletions pkg/manager/member/pd_member_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -827,15 +827,6 @@ func clusterVersionGreaterThanOrEqualTo4(version string) (bool, error) {
return v.Major() >= 4, nil
}

func clusterVersionLessThan2(version string) (bool, error) {
v, err := semver.NewVersion(version)
if err != nil {
return true, err
}

return v.Major() < 2, nil
}

func (pmm *pdMemberManager) collectUnjoinedMembers(tc *v1alpha1.TidbCluster, set *apps.StatefulSet, pdStatus map[string]v1alpha1.PDMember) error {
podSelector, podSelectErr := metav1.LabelSelectorAsSelector(set.Spec.Selector)
if podSelectErr != nil {
Expand Down