From 0535fc8330fdcaac189a61a67a1dde7f5e789f8c Mon Sep 17 00:00:00 2001 From: Alex Giurgiu Date: Fri, 12 Jul 2024 06:19:28 +0300 Subject: [PATCH] [milvus] Ability to use user specified ConfigMap for Milvus configuration (#97) * added new value for using a custom ConfigMap Signed-off-by: Alex Giurgiu * the fully customized user config should be mounted at user.yaml Signed-off-by: Alex Giurgiu * bumped version Signed-off-by: Alex Giurgiu --------- Signed-off-by: Alex Giurgiu --- charts/milvus/Chart.yaml | 2 +- charts/milvus/README.md | 3 ++- charts/milvus/templates/configmap.yaml | 3 +++ charts/milvus/templates/datacoord-deployment.yaml | 11 +++++++++++ charts/milvus/templates/datanode-deployment.yaml | 11 +++++++++++ charts/milvus/templates/indexcoord-deployment.yaml | 11 +++++++++++ charts/milvus/templates/indexnode-deployment.yaml | 11 +++++++++++ charts/milvus/templates/mixcoord-deployment.yaml | 13 ++++++++++++- charts/milvus/templates/proxy-deployment.yaml | 11 +++++++++++ charts/milvus/templates/querycoord-deployment.yaml | 11 +++++++++++ charts/milvus/templates/querynode-deployment.yaml | 11 +++++++++++ charts/milvus/templates/rootcoord-deployment.yaml | 11 +++++++++++ charts/milvus/templates/standalone-deployment.yaml | 11 +++++++++++ charts/milvus/values.yaml | 7 +++++++ 14 files changed, 124 insertions(+), 3 deletions(-) diff --git a/charts/milvus/Chart.yaml b/charts/milvus/Chart.yaml index 76f8441..0af4672 100644 --- a/charts/milvus/Chart.yaml +++ b/charts/milvus/Chart.yaml @@ -3,7 +3,7 @@ name: milvus appVersion: "2.4.5" kubeVersion: "^1.10.0-0" description: Milvus is an open-source vector database built to power AI applications and vector similarity search. -version: 4.1.34 +version: 4.1.35 keywords: - milvus - elastic diff --git a/charts/milvus/README.md b/charts/milvus/README.md index b0de9b8..1c14b3a 100644 --- a/charts/milvus/README.md +++ b/charts/milvus/README.md @@ -214,7 +214,7 @@ In case you want to use a different `secretName` or mount path inside pod, modif ## Milvus with External Object Storage -As of https://github.com/minio/minio/releases/tag/RELEASE.2022-10-29T06-21-33Z, the MinIO Gateway and the related filesystem mode code have been removed. It is now recommended to utilize the `externalS3` configuration for integrating with various object storage services. Notably, Milvus now provides support for popular object storage platforms such as AWS S3, GCP GCS, Azure Blob, Aliyun OSS and Tencent COS. +As of https://github.com/minio/minio/releases/tag/RELEASE.2022-10-29T06-21-33Z, the MinIO Gateway and the related filesystem mode code have been removed. It is now recommended to utilize the `externalS3` configuration for integrating with various object storage services. Notably, Milvus now provides support for popular object storage platforms such as AWS S3, GCP GCS, Azure Blob, Aliyun OSS and Tencent COS. The recommended configuration option for `externalS3.cloudProvider` includes the following choices: `aws`, `gcp`, `azure`, `aliyun`, and `tencent`. Here's an example to use AWS S3 for Milvus object storage: @@ -266,6 +266,7 @@ The following table lists the configurable parameters of the Milvus Service and | `image.tools.repository` | Config image repository | `milvusdb/milvus-config-tool` | | `image.tools.tag` | Config image tag | `v0.1.2` | | `image.tools.pullPolicy` | Config image pull policy | `IfNotPresent` | +| `customConfigMap` | User specified ConfigMap for configuration | | `extraConfigFiles` | Extra config to override default milvus.yaml | `user.yaml:` | | `service.type` | Service type | `ClusterIP` | | `service.port` | Port where service is exposed | `19530` | diff --git a/charts/milvus/templates/configmap.yaml b/charts/milvus/templates/configmap.yaml index 68cc099..6e71f0e 100644 --- a/charts/milvus/templates/configmap.yaml +++ b/charts/milvus/templates/configmap.yaml @@ -1,3 +1,5 @@ +# If customConfigMap is not set, this ConfigMap will be redendered. +{{- if not .Values.customConfigMap }} apiVersion: v1 kind: ConfigMap metadata: @@ -10,3 +12,4 @@ data: {{ $key }}: |- {{ $value | indent 4 }} {{- end }} +{{- end }} diff --git a/charts/milvus/templates/datacoord-deployment.yaml b/charts/milvus/templates/datacoord-deployment.yaml index 34d00b4..c65f2bf 100644 --- a/charts/milvus/templates/datacoord-deployment.yaml +++ b/charts/milvus/templates/datacoord-deployment.yaml @@ -121,6 +121,12 @@ spec: resources: {{- toYaml .Values.dataCoordinator.resources | nindent 10 }} volumeMounts: + {{- if .Values.customConfigMap }} + - name: milvus-config + mountPath: /milvus/configs/user.yaml + subPath: milvus.yaml + readOnly: true + {{- else }} - name: milvus-config mountPath: /milvus/configs/default.yaml subPath: default.yaml @@ -129,6 +135,7 @@ spec: mountPath: /milvus/configs/user.yaml subPath: user.yaml readOnly: true + {{- end }} {{- if .Values.log.persistence.enabled }} - name: milvus-logs-disk mountPath: {{ .Values.log.persistence.mountPath | quote }} @@ -165,7 +172,11 @@ spec: volumes: - name: milvus-config configMap: + {{- if .Values.customConfigMap }} + name: {{ .Values.customConfigMap }} + {{- else }} name: {{ template "milvus.fullname" . }} + {{- end }} {{- if .Values.log.persistence.enabled }} - name: milvus-logs-disk persistentVolumeClaim: diff --git a/charts/milvus/templates/datanode-deployment.yaml b/charts/milvus/templates/datanode-deployment.yaml index ef88a3b..72c8ef6 100644 --- a/charts/milvus/templates/datanode-deployment.yaml +++ b/charts/milvus/templates/datanode-deployment.yaml @@ -117,6 +117,12 @@ spec: resources: {{- toYaml .Values.dataNode.resources | nindent 10 }} volumeMounts: + {{- if .Values.customConfigMap }} + - name: milvus-config + mountPath: /milvus/configs/user.yaml + subPath: milvus.yaml + readOnly: true + {{- else }} - name: milvus-config mountPath: /milvus/configs/default.yaml subPath: default.yaml @@ -125,6 +131,7 @@ spec: mountPath: /milvus/configs/user.yaml subPath: user.yaml readOnly: true + {{- end }} {{- if .Values.log.persistence.enabled }} - name: milvus-logs-disk mountPath: {{ .Values.log.persistence.mountPath | quote }} @@ -160,7 +167,11 @@ spec: volumes: - name: milvus-config configMap: + {{- if .Values.customConfigMap }} + name: {{ .Values.customConfigMap }} + {{- else }} name: {{ template "milvus.fullname" . }} + {{- end }} {{- if .Values.log.persistence.enabled }} - name: milvus-logs-disk persistentVolumeClaim: diff --git a/charts/milvus/templates/indexcoord-deployment.yaml b/charts/milvus/templates/indexcoord-deployment.yaml index f876943..6ae9b6e 100644 --- a/charts/milvus/templates/indexcoord-deployment.yaml +++ b/charts/milvus/templates/indexcoord-deployment.yaml @@ -121,6 +121,12 @@ spec: resources: {{- toYaml .Values.indexCoordinator.resources | nindent 10 }} volumeMounts: + {{- if .Values.customConfigMap }} + - name: milvus-config + mountPath: /milvus/configs/user.yaml + subPath: milvus.yaml + readOnly: true + {{- else }} - name: milvus-config mountPath: /milvus/configs/default.yaml subPath: default.yaml @@ -129,6 +135,7 @@ spec: mountPath: /milvus/configs/user.yaml subPath: user.yaml readOnly: true + {{- end }} {{- if .Values.log.persistence.enabled }} - name: milvus-logs-disk mountPath: {{ .Values.log.persistence.mountPath | quote }} @@ -165,7 +172,11 @@ spec: volumes: - name: milvus-config configMap: + {{- if .Values.customConfigMap }} + name: {{ .Values.customConfigMap }} + {{- else }} name: {{ template "milvus.fullname" . }} + {{- end }} {{- if .Values.log.persistence.enabled }} - name: milvus-logs-disk persistentVolumeClaim: diff --git a/charts/milvus/templates/indexnode-deployment.yaml b/charts/milvus/templates/indexnode-deployment.yaml index 2303f4a..9321d52 100644 --- a/charts/milvus/templates/indexnode-deployment.yaml +++ b/charts/milvus/templates/indexnode-deployment.yaml @@ -123,6 +123,12 @@ spec: resources: {{- toYaml .Values.indexNode.resources | nindent 10 }} volumeMounts: + {{- if .Values.customConfigMap }} + - name: milvus-config + mountPath: /milvus/configs/user.yaml + subPath: milvus.yaml + readOnly: true + {{- else }} - name: milvus-config mountPath: /milvus/configs/default.yaml subPath: default.yaml @@ -131,6 +137,7 @@ spec: mountPath: /milvus/configs/user.yaml subPath: user.yaml readOnly: true + {{- end }} {{- if .Values.log.persistence.enabled }} - name: milvus-logs-disk mountPath: {{ .Values.log.persistence.mountPath | quote }} @@ -172,7 +179,11 @@ spec: volumes: - name: milvus-config configMap: + {{- if .Values.customConfigMap }} + name: {{ .Values.customConfigMap }} + {{- else }} name: {{ template "milvus.fullname" . }} + {{- end }} {{- if .Values.log.persistence.enabled }} - name: milvus-logs-disk persistentVolumeClaim: diff --git a/charts/milvus/templates/mixcoord-deployment.yaml b/charts/milvus/templates/mixcoord-deployment.yaml index 86ab063..543c7b6 100644 --- a/charts/milvus/templates/mixcoord-deployment.yaml +++ b/charts/milvus/templates/mixcoord-deployment.yaml @@ -118,6 +118,12 @@ spec: resources: {{- toYaml .Values.mixCoordinator.resources | nindent 10 }} volumeMounts: + {{- if .Values.customConfigMap }} + - name: milvus-config + mountPath: /milvus/configs/user.yaml + subPath: milvus.yaml + readOnly: true + {{- else }} - name: milvus-config mountPath: /milvus/configs/default.yaml subPath: default.yaml @@ -126,6 +132,7 @@ spec: mountPath: /milvus/configs/user.yaml subPath: user.yaml readOnly: true + {{- end }} {{- if .Values.log.persistence.enabled }} - name: milvus-logs-disk mountPath: {{ .Values.log.persistence.mountPath | quote }} @@ -162,7 +169,11 @@ spec: volumes: - name: milvus-config configMap: + {{- if .Values.customConfigMap }} + name: {{ .Values.customConfigMap }} + {{- else }} name: {{ template "milvus.fullname" . }} + {{- end }} {{- if .Values.log.persistence.enabled }} - name: milvus-logs-disk persistentVolumeClaim: @@ -170,4 +181,4 @@ spec: {{- end }} - name: tools emptyDir: {} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/milvus/templates/proxy-deployment.yaml b/charts/milvus/templates/proxy-deployment.yaml index f9c278f..e19311a 100644 --- a/charts/milvus/templates/proxy-deployment.yaml +++ b/charts/milvus/templates/proxy-deployment.yaml @@ -117,6 +117,12 @@ spec: resources: {{- toYaml .Values.proxy.resources | nindent 10 }} volumeMounts: + {{- if .Values.customConfigMap }} + - name: milvus-config + mountPath: /milvus/configs/user.yaml + subPath: milvus.yaml + readOnly: true + {{- else }} - name: milvus-config mountPath: /milvus/configs/default.yaml subPath: default.yaml @@ -125,6 +131,7 @@ spec: mountPath: /milvus/configs/user.yaml subPath: user.yaml readOnly: true + {{- end }} {{- if .Values.log.persistence.enabled }} - name: milvus-logs-disk mountPath: {{ .Values.log.persistence.mountPath | quote }} @@ -164,7 +171,11 @@ spec: volumes: - name: milvus-config configMap: + {{- if .Values.customConfigMap }} + name: {{ .Values.customConfigMap }} + {{- else }} name: {{ template "milvus.fullname" . }} + {{- end }} {{- if .Values.log.persistence.enabled }} - name: milvus-logs-disk persistentVolumeClaim: diff --git a/charts/milvus/templates/querycoord-deployment.yaml b/charts/milvus/templates/querycoord-deployment.yaml index e3159c9..90694fb 100644 --- a/charts/milvus/templates/querycoord-deployment.yaml +++ b/charts/milvus/templates/querycoord-deployment.yaml @@ -121,6 +121,12 @@ spec: resources: {{- toYaml .Values.queryCoordinator.resources | nindent 10 }} volumeMounts: + {{- if .Values.customConfigMap }} + - name: milvus-config + mountPath: /milvus/configs/user.yaml + subPath: milvus.yaml + readOnly: true + {{- else }} - name: milvus-config mountPath: /milvus/configs/default.yaml subPath: default.yaml @@ -129,6 +135,7 @@ spec: mountPath: /milvus/configs/user.yaml subPath: user.yaml readOnly: true + {{- end }} {{- if .Values.log.persistence.enabled }} - name: milvus-logs-disk mountPath: {{ .Values.log.persistence.mountPath | quote }} @@ -165,7 +172,11 @@ spec: volumes: - name: milvus-config configMap: + {{- if .Values.customConfigMap }} + name: {{ .Values.customConfigMap }} + {{- else }} name: {{ template "milvus.fullname" . }} + {{- end }} {{- if .Values.log.persistence.enabled }} - name: milvus-logs-disk persistentVolumeClaim: diff --git a/charts/milvus/templates/querynode-deployment.yaml b/charts/milvus/templates/querynode-deployment.yaml index c470aa5..888d655 100644 --- a/charts/milvus/templates/querynode-deployment.yaml +++ b/charts/milvus/templates/querynode-deployment.yaml @@ -123,6 +123,12 @@ spec: resources: {{- toYaml .Values.queryNode.resources | nindent 10 }} volumeMounts: + {{- if .Values.customConfigMap }} + - name: milvus-config + mountPath: /milvus/configs/user.yaml + subPath: milvus.yaml + readOnly: true + {{- else }} - name: milvus-config mountPath: /milvus/configs/default.yaml subPath: default.yaml @@ -131,6 +137,7 @@ spec: mountPath: /milvus/configs/user.yaml subPath: user.yaml readOnly: true + {{- end }} {{- if .Values.log.persistence.enabled }} - name: milvus-logs-disk mountPath: {{ .Values.log.persistence.mountPath | quote }} @@ -171,7 +178,11 @@ spec: volumes: - name: milvus-config configMap: + {{- if .Values.customConfigMap }} + name: {{ .Values.customConfigMap }} + {{- else }} name: {{ template "milvus.fullname" . }} + {{- end }} {{- if .Values.log.persistence.enabled }} - name: milvus-logs-disk persistentVolumeClaim: diff --git a/charts/milvus/templates/rootcoord-deployment.yaml b/charts/milvus/templates/rootcoord-deployment.yaml index 2e16efe..2100c6a 100644 --- a/charts/milvus/templates/rootcoord-deployment.yaml +++ b/charts/milvus/templates/rootcoord-deployment.yaml @@ -121,6 +121,12 @@ spec: resources: {{- toYaml .Values.rootCoordinator.resources | nindent 10 }} volumeMounts: + {{- if .Values.customConfigMap }} + - name: milvus-config + mountPath: /milvus/configs/user.yaml + subPath: milvus.yaml + readOnly: true + {{- else }} - name: milvus-config mountPath: /milvus/configs/default.yaml subPath: default.yaml @@ -129,6 +135,7 @@ spec: mountPath: /milvus/configs/user.yaml subPath: user.yaml readOnly: true + {{- end }} {{- if .Values.log.persistence.enabled }} - name: milvus-logs-disk mountPath: {{ .Values.log.persistence.mountPath | quote }} @@ -165,7 +172,11 @@ spec: volumes: - name: milvus-config configMap: + {{- if .Values.customConfigMap }} + name: {{ .Values.customConfigMap }} + {{- else }} name: {{ template "milvus.fullname" . }} + {{- end }} {{- if .Values.log.persistence.enabled }} - name: milvus-logs-disk persistentVolumeClaim: diff --git a/charts/milvus/templates/standalone-deployment.yaml b/charts/milvus/templates/standalone-deployment.yaml index 26c59f5..74770fc 100644 --- a/charts/milvus/templates/standalone-deployment.yaml +++ b/charts/milvus/templates/standalone-deployment.yaml @@ -121,6 +121,12 @@ spec: volumeMounts: - mountPath: /milvus/tools name: tools + {{- if .Values.customConfigMap }} + - name: milvus-config + mountPath: /milvus/configs/user.yaml + subPath: milvus.yaml + readOnly: true + {{- else }} - name: milvus-config mountPath: /milvus/configs/default.yaml subPath: default.yaml @@ -129,6 +135,7 @@ spec: mountPath: /milvus/configs/user.yaml subPath: user.yaml readOnly: true + {{- end }} - name: milvus-data-disk mountPath: {{ .Values.standalone.persistence.mountPath | quote }} subPath: {{ .Values.standalone.persistence.persistentVolumeClaim.subPath | default "" }} @@ -172,7 +179,11 @@ spec: name: tools - name: milvus-config configMap: + {{- if .Values.customConfigMap }} + name: {{ .Values.customConfigMap }} + {{- else }} name: {{ template "milvus.fullname" . }} + {{- end }} - name: milvus-data-disk {{- if .Values.standalone.persistence.enabled }} persistentVolumeClaim: diff --git a/charts/milvus/values.yaml b/charts/milvus/values.yaml index 1c7a234..43e0c73 100644 --- a/charts/milvus/values.yaml +++ b/charts/milvus/values.yaml @@ -38,6 +38,13 @@ affinity: {} labels: {} annotations: {} +## +## If set, the whole config will be mounted from this custom ConfigMap. +## The ConfigMap should have a key named `milvus.yaml` which contains the full Milvus config. +## extraConfigFiles will be ignored if this variable is set. +## +customConfigMap: "" + # Extra configs for milvus.yaml # If set, this config will merge into milvus.yaml # Please follow the config structure in the milvus.yaml