Skip to content
This repository was archived by the owner on Aug 16, 2023. It is now read-only.

Commit 8a1c4da

Browse files
authored
Add dynamic config for milvus (#394)
Signed-off-by: Edward Zeng <jie.zeng@zilliz.com> Signed-off-by: Edward Zeng <jie.zeng@zilliz.com>
1 parent 33bddf8 commit 8a1c4da

14 files changed

+234
-109
lines changed

charts/milvus/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: milvus
33
appVersion: "2.2.0"
44
kubeVersion: "^1.10.0-0"
55
description: Milvus is an open-source vector database built to power AI applications and vector similarity search.
6-
version: 3.3.1
6+
version: 3.3.2
77
keywords:
88
- milvus
99
- elastic

charts/milvus/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ The following table lists the configurable parameters of the Milvus Service and
103103
| `image.all.tag` | Image tag | `v2.1.4` |
104104
| `image.all.pullPolicy` | Image pull policy | `IfNotPresent` |
105105
| `image.all.pullSecrets` | Image pull secrets | `{}` |
106+
| `extraConfigFiles` | Extra config to override default milvus.yaml | `user.yaml:` |
106107
| `service.type` | Service type | `ClusterIP` |
107108
| `service.port` | Port where service is exposed | `19530` |
108109
| `service.nodePort` | Service nodePort | `unset` |
@@ -311,6 +312,7 @@ The following table lists the configurable parameters of the Milvus Query Node c
311312
| `queryNode.extraEnv` | Additional Milvus Query Node container environment variables | `[]` |
312313
| `queryNode.grouping.enabled` | Enable grouping small nq search | `true` |
313314
| `queryNode.grouping.maxNQ` | Grouping small nq search max threshold | `1000` |
315+
| `queryNode.scheduler.maxReadConcurrentRatio` | Concurrency ratio of read tasks | `2.0` |
314316

315317
### Milvus Index Coordinator Deployment Configuration
316318

charts/milvus/templates/config.tpl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,17 @@ minio:
102102

103103
{{- if .Values.externalPulsar.enabled }}
104104

105+
messageQueue: pulsar
106+
105107
pulsar:
106108
address: {{ .Values.externalPulsar.host }}
107109
port: {{ .Values.externalPulsar.port }}
108110
maxMessageSize: {{ .Values.externalPulsar.maxMessageSize }}
109111

110112
{{- else if .Values.pulsar.enabled }}
111113

114+
messageQueue: pulsar
115+
112116
pulsar:
113117
{{- if contains .Values.pulsar.name .Release.Name }}
114118
address: {{ .Release.Name }}-proxy
@@ -121,6 +125,8 @@ pulsar:
121125

122126
{{- if .Values.externalKafka.enabled }}
123127

128+
messageQueue: kafka
129+
124130
kafka:
125131
brokerList: {{ .Values.externalKafka.brokerList }}
126132
securityProtocol: {{ .Values.externalKafka.securityProtocol }}
@@ -133,6 +139,8 @@ kafka:
133139
{{- end }}
134140
{{- else if .Values.kafka.enabled }}
135141

142+
messageQueue: kafka
143+
136144
kafka:
137145
{{- if contains .Values.kafka.name .Release.Name }}
138146
brokerList: {{ .Release.Name }}:{{ .Values.kafka.service.ports.client }}
@@ -143,6 +151,8 @@ kafka:
143151

144152
{{- if and (not .Values.cluster.enabled) (eq .Values.standalone.messageQueue "rocksmq") }}
145153

154+
messageQueue: rocksmq
155+
146156
rocksmq:
147157
path: "{{ .Values.standalone.persistence.mountPath }}/rdb_data"
148158
rocksmqPageSize: "{{ .Values.standalone.rocksmq.rocksmqPageSize }}" # 2 GB
@@ -228,7 +238,7 @@ queryNode:
228238
scheduler:
229239
receiveChanSize: 10240
230240
unsolvedQueueSize: 10240
231-
maxReadConcurrency: 0 # maximum concurrency of read task. if set to less or equal 0, it means no uppper limit.
241+
maxReadConcurrentRatio: "{{ .Values.queryNode.scheduler.maxReadConcurrentRatio }}"
232242
cpuRatio: 10.0 # ratio used to estimate read task cpu usage.
233243

234244
grouping:

charts/milvus/templates/configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: ConfigMap
33
metadata:
44
name: {{ template "milvus.fullname" . }}
55
data:
6-
milvus.yaml: |+
6+
default.yaml: |+
77
{{- include "milvus.config" . | nindent 4 }}
88
99
{{- range $key, $value := .Values.extraConfigFiles }}

charts/milvus/templates/datacoord-deployment.yaml

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ spec:
4040
- name: {{ . }}
4141
{{- end }}
4242
{{- end }}
43-
{{- if .Values.dataCoordinator.heaptrack.enabled }}
4443
initContainers:
44+
{{- if .Values.dataCoordinator.heaptrack.enabled }}
4545
- name: heaptrack
4646
command:
4747
- /bin/bash
@@ -51,16 +51,26 @@ spec:
5151
imagePullPolicy: {{ .Values.heaptrack.image.pullPolicy }}
5252
volumeMounts:
5353
- mountPath: /milvus/tools
54-
name: heaptrack
54+
name: tools
5555
{{- end }}
56+
- name: config
57+
command:
58+
- /cp
59+
- /run-helm.sh,/merge
60+
- /milvus/tools/run-helm.sh,/milvus/tools/merge
61+
image: "{{ .Values.image.tools.repository }}:{{ .Values.image.tools.tag }}"
62+
imagePullPolicy: {{ .Values.image.tools.pullPolicy}}
63+
volumeMounts:
64+
- mountPath: /milvus/tools
65+
name: tools
5666
containers:
5767
- name: datacoord
5868
image: "{{ .Values.image.all.repository }}:{{ .Values.image.all.tag }}"
5969
imagePullPolicy: {{ .Values.image.all.pullPolicy }}
6070
{{- if .Values.dataCoordinator.heaptrack.enabled }}
61-
args: ["/milvus/tools/heaptrack/bin/heaptrack", "milvus", "run", "datacoord"]
71+
args: [ "/milvus/tools/heaptrack/bin/heaptrack", "/milvus/tools/run-helm.sh", "milvus", "run", "datacoord" ]
6272
{{- else }}
63-
args: [ "milvus", "run", "datacoord" ]
73+
args: [ "/milvus/tools/run-helm.sh", "milvus", "run", "datacoord" ]
6474
{{- end }}
6575
env:
6676
{{- if .Values.dataCoordinator.heaptrack.enabled }}
@@ -103,18 +113,20 @@ spec:
103113
{{- toYaml .Values.dataCoordinator.resources | nindent 10 }}
104114
volumeMounts:
105115
- name: milvus-config
106-
mountPath: /milvus/configs/milvus.yaml
107-
subPath: milvus.yaml
116+
mountPath: /milvus/configs/default.yaml
117+
subPath: default.yaml
118+
readOnly: true
119+
- name: milvus-config
120+
mountPath: /milvus/configs/user.yaml
121+
subPath: user.yaml
108122
readOnly: true
109123
{{- if .Values.log.persistence.enabled }}
110124
- name: milvus-logs-disk
111125
mountPath: {{ .Values.log.persistence.mountPath | quote }}
112126
subPath: {{ .Values.log.persistence.persistentVolumeClaim.subPath | default "" }}
113127
{{- end }}
114-
{{- if .Values.dataCoordinator.heaptrack.enabled }}
115128
- mountPath: /milvus/tools
116-
name: heaptrack
117-
{{- end }}
129+
name: tools
118130

119131
{{- if and (.Values.nodeSelector) (not .Values.dataCoordinator.nodeSelector) }}
120132
nodeSelector:
@@ -150,8 +162,6 @@ spec:
150162
persistentVolumeClaim:
151163
claimName: {{ .Values.log.persistence.persistentVolumeClaim.existingClaim | default (printf "%s-logs" (include "milvus.fullname" . | trunc 58)) }}
152164
{{- end }}
153-
{{- if .Values.dataCoordinator.heaptrack.enabled }}
154-
- name: heaptrack
165+
- name: tools
155166
emptyDir: {}
156-
{{- end }}
157167
{{- end }}

charts/milvus/templates/datanode-deployment.yaml

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ spec:
3939
- name: {{ . }}
4040
{{- end }}
4141
{{- end }}
42-
{{- if .Values.dataNode.heaptrack.enabled }}
4342
initContainers:
43+
{{- if .Values.dataNode.heaptrack.enabled }}
4444
- name: heaptrack
4545
command:
4646
- /bin/bash
@@ -50,16 +50,26 @@ spec:
5050
imagePullPolicy: {{ .Values.heaptrack.image.pullPolicy }}
5151
volumeMounts:
5252
- mountPath: /milvus/tools
53-
name: heaptrack
53+
name: tools
5454
{{- end }}
55+
- name: config
56+
command:
57+
- /cp
58+
- /run-helm.sh,/merge
59+
- /milvus/tools/run-helm.sh,/milvus/tools/merge
60+
image: "{{ .Values.image.tools.repository }}:{{ .Values.image.tools.tag }}"
61+
imagePullPolicy: {{ .Values.image.tools.pullPolicy}}
62+
volumeMounts:
63+
- mountPath: /milvus/tools
64+
name: tools
5565
containers:
5666
- name: datanode
5767
image: "{{ .Values.image.all.repository }}:{{ .Values.image.all.tag }}"
5868
imagePullPolicy: {{ .Values.image.all.pullPolicy }}
5969
{{- if .Values.dataNode.heaptrack.enabled }}
60-
args: [ "/milvus/tools/heaptrack/bin/heaptrack", "milvus", "run", "datanode" ]
70+
args: [ "/milvus/tools/heaptrack/bin/heaptrack", "/milvus/tools/run-helm.sh", "milvus", "run", "datanode" ]
6171
{{- else }}
62-
args: [ "milvus", "run", "datanode" ]
72+
args: [ "/milvus/tools/run-helm.sh", "milvus", "run", "datanode" ]
6373
{{- end }}
6474
env:
6575
{{- if .Values.dataNode.heaptrack.enabled }}
@@ -102,18 +112,20 @@ spec:
102112
{{- toYaml .Values.dataNode.resources | nindent 10 }}
103113
volumeMounts:
104114
- name: milvus-config
105-
mountPath: /milvus/configs/milvus.yaml
106-
subPath: milvus.yaml
115+
mountPath: /milvus/configs/default.yaml
116+
subPath: default.yaml
117+
readOnly: true
118+
- name: milvus-config
119+
mountPath: /milvus/configs/user.yaml
120+
subPath: user.yaml
107121
readOnly: true
108122
{{- if .Values.log.persistence.enabled }}
109123
- name: milvus-logs-disk
110124
mountPath: {{ .Values.log.persistence.mountPath | quote }}
111125
subPath: {{ .Values.log.persistence.persistentVolumeClaim.subPath | default "" }}
112126
{{- end }}
113-
{{- if .Values.dataNode.heaptrack.enabled }}
114127
- mountPath: /milvus/tools
115-
name: heaptrack
116-
{{- end }}
128+
name: tools
117129

118130
{{- if and (.Values.nodeSelector) (not .Values.dataNode.nodeSelector) }}
119131
nodeSelector:
@@ -148,8 +160,6 @@ spec:
148160
persistentVolumeClaim:
149161
claimName: {{ .Values.log.persistence.persistentVolumeClaim.existingClaim | default (printf "%s-logs" (include "milvus.fullname" . | trunc 58)) }}
150162
{{- end }}
151-
{{- if .Values.dataNode.heaptrack.enabled }}
152-
- name: heaptrack
163+
- name: tools
153164
emptyDir: {}
154-
{{- end }}
155165
{{- end }}

charts/milvus/templates/indexcoord-deployment.yaml

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ spec:
4040
- name: {{ . }}
4141
{{- end }}
4242
{{- end }}
43-
{{- if .Values.indexCoordinator.heaptrack.enabled }}
4443
initContainers:
44+
{{- if .Values.indexCoordinator.heaptrack.enabled }}
4545
- name: heaptrack
4646
command:
4747
- /bin/bash
@@ -51,16 +51,26 @@ spec:
5151
imagePullPolicy: {{ .Values.heaptrack.image.pullPolicy }}
5252
volumeMounts:
5353
- mountPath: /milvus/tools
54-
name: heaptrack
54+
name: tools
5555
{{- end }}
56+
- name: config
57+
command:
58+
- /cp
59+
- /run-helm.sh,/merge
60+
- /milvus/tools/run-helm.sh,/milvus/tools/merge
61+
image: "{{ .Values.image.tools.repository }}:{{ .Values.image.tools.tag }}"
62+
imagePullPolicy: {{ .Values.image.tools.pullPolicy}}
63+
volumeMounts:
64+
- mountPath: /milvus/tools
65+
name: tools
5666
containers:
5767
- name: indexcoord
5868
image: "{{ .Values.image.all.repository }}:{{ .Values.image.all.tag }}"
5969
imagePullPolicy: {{ .Values.image.all.pullPolicy }}
6070
{{- if .Values.indexCoordinator.heaptrack.enabled }}
61-
args: [ "/milvus/tools/heaptrack/bin/heaptrack", "milvus", "run", "indexcoord" ]
71+
args: [ "/milvus/tools/heaptrack/bin/heaptrack", "/milvus/tools/run-helm.sh", "milvus", "run", "indexcoord" ]
6272
{{- else }}
63-
args: [ "milvus", "run", "indexcoord" ]
73+
args: [ "/milvus/tools/run-helm.sh", "milvus", "run", "indexcoord" ]
6474
{{- end }}
6575
env:
6676
{{- if .Values.indexCoordinator.heaptrack.enabled }}
@@ -103,18 +113,20 @@ spec:
103113
{{- toYaml .Values.indexCoordinator.resources | nindent 10 }}
104114
volumeMounts:
105115
- name: milvus-config
106-
mountPath: /milvus/configs/milvus.yaml
107-
subPath: milvus.yaml
116+
mountPath: /milvus/configs/default.yaml
117+
subPath: default.yaml
118+
readOnly: true
119+
- name: milvus-config
120+
mountPath: /milvus/configs/user.yaml
121+
subPath: user.yaml
108122
readOnly: true
109123
{{- if .Values.log.persistence.enabled }}
110124
- name: milvus-logs-disk
111125
mountPath: {{ .Values.log.persistence.mountPath | quote }}
112126
subPath: {{ .Values.log.persistence.persistentVolumeClaim.subPath | default "" }}
113127
{{- end }}
114-
{{- if .Values.indexCoordinator.heaptrack.enabled }}
115128
- mountPath: /milvus/tools
116-
name: heaptrack
117-
{{- end }}
129+
name: tools
118130

119131
{{- if and (.Values.nodeSelector) (not .Values.indexCoordinator.nodeSelector) }}
120132
nodeSelector:
@@ -150,8 +162,6 @@ spec:
150162
persistentVolumeClaim:
151163
claimName: {{ .Values.log.persistence.persistentVolumeClaim.existingClaim | default (printf "%s-logs" (include "milvus.fullname" . | trunc 58)) }}
152164
{{- end }}
153-
{{- if .Values.indexCoordinator.heaptrack.enabled }}
154-
- name: heaptrack
165+
- name: tools
155166
emptyDir: {}
156-
{{- end }}
157167
{{- end }}

charts/milvus/templates/indexnode-deployment.yaml

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ spec:
3838
- name: {{ . }}
3939
{{- end }}
4040
{{- end }}
41-
{{- if .Values.indexNode.heaptrack.enabled }}
4241
initContainers:
42+
{{- if .Values.indexNode.heaptrack.enabled }}
4343
- name: heaptrack
4444
command:
4545
- /bin/bash
@@ -49,16 +49,26 @@ spec:
4949
imagePullPolicy: {{ .Values.heaptrack.image.pullPolicy }}
5050
volumeMounts:
5151
- mountPath: /milvus/tools
52-
name: heaptrack
52+
name: tools
5353
{{- end }}
54+
- name: config
55+
command:
56+
- /cp
57+
- /run-helm.sh,/merge
58+
- /milvus/tools/run-helm.sh,/milvus/tools/merge
59+
image: "{{ .Values.image.tools.repository }}:{{ .Values.image.tools.tag }}"
60+
imagePullPolicy: {{ .Values.image.tools.pullPolicy}}
61+
volumeMounts:
62+
- mountPath: /milvus/tools
63+
name: tools
5464
containers:
5565
- name: indexnode
5666
image: "{{ .Values.image.all.repository }}:{{ .Values.image.all.tag }}"
5767
imagePullPolicy: {{ .Values.image.all.pullPolicy }}
5868
{{- if .Values.indexNode.heaptrack.enabled }}
59-
args: [ "/milvus/tools/heaptrack/bin/heaptrack", "milvus", "run", "indexnode" ]
69+
args: [ "/milvus/tools/heaptrack/bin/heaptrack", "/milvus/tools/run-helm.sh", "milvus", "run", "indexnode" ]
6070
{{- else }}
61-
args: [ "milvus", "run", "indexnode" ]
71+
args: [ "/milvus/tools/run-helm.sh", "milvus", "run", "indexnode" ]
6272
{{- end }}
6373
env:
6474
{{- if .Values.indexNode.heaptrack.enabled }}
@@ -108,18 +118,20 @@ spec:
108118
{{- toYaml .Values.indexNode.resources | nindent 10 }}
109119
volumeMounts:
110120
- name: milvus-config
111-
mountPath: /milvus/configs/milvus.yaml
112-
subPath: milvus.yaml
121+
mountPath: /milvus/configs/default.yaml
122+
subPath: default.yaml
123+
readOnly: true
124+
- name: milvus-config
125+
mountPath: /milvus/configs/user.yaml
126+
subPath: user.yaml
113127
readOnly: true
114128
{{- if .Values.log.persistence.enabled }}
115129
- name: milvus-logs-disk
116130
mountPath: {{ .Values.log.persistence.mountPath | quote }}
117131
subPath: {{ .Values.log.persistence.persistentVolumeClaim.subPath | default "" }}
118132
{{- end }}
119-
{{- if .Values.indexNode.heaptrack.enabled }}
120133
- mountPath: /milvus/tools
121-
name: heaptrack
122-
{{- end }}
134+
name: tools
123135
{{- if .Values.indexNode.disk.enabled }}
124136
- mountPath: /milvus/data
125137
name: disk
@@ -160,10 +172,8 @@ spec:
160172
persistentVolumeClaim:
161173
claimName: {{ .Values.log.persistence.persistentVolumeClaim.existingClaim | default (printf "%s-logs" (include "milvus.fullname" . | trunc 58)) }}
162174
{{- end }}
163-
{{- if .Values.indexNode.heaptrack.enabled }}
164-
- name: heaptrack
175+
- name: tools
165176
emptyDir: {}
166-
{{- end }}
167177
{{- if .Values.indexNode.disk.enabled }}
168178
- name: disk
169179
emptyDir: {}

0 commit comments

Comments
 (0)