Skip to content

Commit

Permalink
add configmap for dm-master
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielZhangQD committed Feb 24, 2020
1 parent 73d2a39 commit 227557e
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 deletions.
8 changes: 5 additions & 3 deletions manifests/dm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ This document describes how to deploy DM of the new HA architecture with the yam

## Deploy dm-master

Update the rpc configs if necessary in `master/config/config.toml`.

{{< copyable "shell-regular" >}}

``` shell
kubectl create -f master/dm-master.yaml -n <namespace>
kubectl apply -k master -n <namespace>
```

> **Note: **
Expand All @@ -28,15 +30,15 @@ kubectl create -f master/dm-master.yaml -n <namespace>
{{< copyable "shell-regular" >}}

``` shell
kubectl kustomize worker/base | kubectl apply -f - -n <namespace>
kubectl apply -k worker/base -n <namespace>
```

- If you need to use DM for both full and incremental data migration, you have to create PVC for dm-worker, deploy it with below command:

{{< copyable "shell-regular" >}}

``` shell
kubectl kustomize worker/overlays/full | kubectl apply -f - -n <namespace>
kubectl apply -k worker/overlays/full -n <namespace>
```

> **Note: **
Expand Down
14 changes: 14 additions & 0 deletions manifests/dm/master/config/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# rpc configuration
#
# rpc timeout is a positive number plus time unit. we use golang standard time
# units including: "ns", "us", "ms", "s", "m", "h". You should provide a proper
# rpc timeout according to your use scenario.
rpc-timeout = "30s"
# rpc limiter controls how frequently events are allowed to happen.
# It implements a "token bucket" of size `rpc-rate-limit`, initially full and
# refilled at rate `rpc-rate-limit` tokens per second. Note `rpc-rate-limit`
# is float64 type, so remember to add a decimal point and one trailing 0 if its
# literal value happens to be an integer.
rpc-rate-limit = 10.0
rpc-rate-burst = 40

9 changes: 8 additions & 1 deletion manifests/dm/master/dm-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ spec:
containers:
- command:
- /dm-master
- -data-dir=/data
- --data-dir=/data
- --config=/etc/config/config.toml
- --name=$(MY_POD_NAME)
- --master-addr=:8261
- --advertise-addr=$(MY_POD_NAME).$(PEER_SERVICE_NAME).$(NAMESPACE):8261
Expand Down Expand Up @@ -82,11 +83,17 @@ spec:
volumeMounts:
- mountPath: /data
name: data
- mountPath: /etc/config
name: config
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- configMap:
name: dm-master-config
name: config
updateStrategy:
rollingUpdate:
partition: 3
Expand Down
10 changes: 10 additions & 0 deletions manifests/dm/master/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resources:
- dm-master.yaml
configMapGenerator:
- name: dm-master-config
files:
- config/config.toml
generatorOptions:
labels:
app.kubernetes.io/component: dm-master

0 comments on commit 227557e

Please sign in to comment.