From e13d302ca05f049e9eae1a0283b8451ae246a76d Mon Sep 17 00:00:00 2001 From: haorenfsa Date: Wed, 27 Nov 2024 15:06:12 +0800 Subject: [PATCH] support custom volumes & volumeMounts Signed-off-by: haorenfsa --- charts/milvus/Chart.yaml | 2 +- charts/milvus/ci/cluster-values.yaml | 6 ++++++ charts/milvus/templates/datacoord-deployment.yaml | 6 ++++++ charts/milvus/templates/datanode-deployment.yaml | 6 ++++++ charts/milvus/templates/indexcoord-deployment.yaml | 6 ++++++ charts/milvus/templates/indexnode-deployment.yaml | 7 ++++++- charts/milvus/templates/mixcoord-deployment.yaml | 6 ++++++ charts/milvus/templates/proxy-deployment.yaml | 7 ++++++- charts/milvus/templates/querycoord-deployment.yaml | 6 ++++++ charts/milvus/templates/querynode-deployment.yaml | 6 ++++++ charts/milvus/templates/rootcoord-deployment.yaml | 6 ++++++ charts/milvus/templates/standalone-deployment.yaml | 6 ++++++ charts/milvus/templates/streamingnode-deployment.yaml | 6 ++++++ charts/milvus/values.yaml | 6 ++++++ 14 files changed, 79 insertions(+), 3 deletions(-) diff --git a/charts/milvus/Chart.yaml b/charts/milvus/Chart.yaml index c9bbee6..f05fadb 100644 --- a/charts/milvus/Chart.yaml +++ b/charts/milvus/Chart.yaml @@ -3,7 +3,7 @@ name: milvus appVersion: "2.5.0-beta" kubeVersion: "^1.10.0-0" description: Milvus is an open-source vector database built to power AI applications and vector similarity search. -version: 4.2.30 +version: 4.2.31 keywords: - milvus - elastic diff --git a/charts/milvus/ci/cluster-values.yaml b/charts/milvus/ci/cluster-values.yaml index d511fbc..14ce6c2 100644 --- a/charts/milvus/ci/cluster-values.yaml +++ b/charts/milvus/ci/cluster-values.yaml @@ -1,6 +1,12 @@ ## Enable or disable Milvus Cluster mode cluster: enabled: true +volumes: +- name: custom + emptyDir: {} +volumeMounts: +- name: custom + mountPath: /custom etcd: replicaCount: 1 minio: diff --git a/charts/milvus/templates/datacoord-deployment.yaml b/charts/milvus/templates/datacoord-deployment.yaml index 1dcc958..b022e78 100644 --- a/charts/milvus/templates/datacoord-deployment.yaml +++ b/charts/milvus/templates/datacoord-deployment.yaml @@ -141,6 +141,9 @@ spec: {{- end }} - mountPath: /milvus/tools name: tools + {{- if .Values.volumeMounts }} + {{- toYaml .Values.volumeMounts | nindent 8 }} + {{- end}} {{- if and (.Values.nodeSelector) (not .Values.dataCoordinator.nodeSelector) }} nodeSelector: @@ -182,4 +185,7 @@ spec: {{- end }} - name: tools emptyDir: {} + {{- if .Values.volumes }} + {{- toYaml .Values.volumes | nindent 6 }} + {{- end}} {{- end }} diff --git a/charts/milvus/templates/datanode-deployment.yaml b/charts/milvus/templates/datanode-deployment.yaml index 1a2a271..11ec00a 100644 --- a/charts/milvus/templates/datanode-deployment.yaml +++ b/charts/milvus/templates/datanode-deployment.yaml @@ -137,6 +137,9 @@ spec: {{- end }} - mountPath: /milvus/tools name: tools + {{- if .Values.volumeMounts }} + {{- toYaml .Values.volumeMounts | nindent 8 }} + {{- end}} {{- if and (.Values.nodeSelector) (not .Values.dataNode.nodeSelector) }} nodeSelector: @@ -177,4 +180,7 @@ spec: {{- end }} - name: tools emptyDir: {} + {{- if .Values.volumes }} + {{- toYaml .Values.volumes | nindent 6 }} + {{- end}} {{- end }} diff --git a/charts/milvus/templates/indexcoord-deployment.yaml b/charts/milvus/templates/indexcoord-deployment.yaml index a62e911..f6e85c6 100644 --- a/charts/milvus/templates/indexcoord-deployment.yaml +++ b/charts/milvus/templates/indexcoord-deployment.yaml @@ -141,6 +141,9 @@ spec: {{- end }} - mountPath: /milvus/tools name: tools + {{- if .Values.volumeMounts }} + {{- toYaml .Values.volumeMounts | nindent 8 }} + {{- end}} {{- if and (.Values.nodeSelector) (not .Values.indexCoordinator.nodeSelector) }} nodeSelector: @@ -182,4 +185,7 @@ spec: {{- end }} - name: tools emptyDir: {} + {{- if .Values.volumes }} + {{- toYaml .Values.volumes | nindent 6 }} + {{- end}} {{- end }} diff --git a/charts/milvus/templates/indexnode-deployment.yaml b/charts/milvus/templates/indexnode-deployment.yaml index e260dd5..f4eadc9 100644 --- a/charts/milvus/templates/indexnode-deployment.yaml +++ b/charts/milvus/templates/indexnode-deployment.yaml @@ -147,7 +147,9 @@ spec: - mountPath: /var/lib/milvus/data name: disk {{- end }} - + {{- if .Values.volumeMounts }} + {{- toYaml .Values.volumeMounts | nindent 8 }} + {{- end}} {{- if and (.Values.nodeSelector) (not .Values.indexNode.nodeSelector) }} nodeSelector: @@ -193,4 +195,7 @@ spec: - name: disk emptyDir: {} {{- end }} + {{- if .Values.volumes }} + {{- toYaml .Values.volumes | nindent 6 }} + {{- end}} {{- end }} diff --git a/charts/milvus/templates/mixcoord-deployment.yaml b/charts/milvus/templates/mixcoord-deployment.yaml index 4eb392f..a20f1b3 100644 --- a/charts/milvus/templates/mixcoord-deployment.yaml +++ b/charts/milvus/templates/mixcoord-deployment.yaml @@ -138,6 +138,9 @@ spec: {{- end }} - mountPath: /milvus/tools name: tools + {{- if .Values.volumeMounts }} + {{- toYaml .Values.volumeMounts | nindent 8 }} + {{- end}} {{- if and (.Values.nodeSelector) (not .Values.mixCoordinator.nodeSelector) }} nodeSelector: @@ -179,4 +182,7 @@ spec: {{- end }} - name: tools emptyDir: {} + {{- if .Values.volumes }} + {{- toYaml .Values.volumes | nindent 6 }} + {{- end}} {{- end }} diff --git a/charts/milvus/templates/proxy-deployment.yaml b/charts/milvus/templates/proxy-deployment.yaml index e366ff2..1d482cf 100644 --- a/charts/milvus/templates/proxy-deployment.yaml +++ b/charts/milvus/templates/proxy-deployment.yaml @@ -140,6 +140,9 @@ spec: {{- if .Values.proxy.volumeMounts }} {{- toYaml .Values.proxy.volumeMounts | nindent 8 }} {{- end}} + {{- if .Values.volumeMounts }} + {{- toYaml .Values.volumeMounts | nindent 8 }} + {{- end}} {{- if and (.Values.nodeSelector) (not .Values.proxy.nodeSelector) }} nodeSelector: @@ -184,5 +187,7 @@ spec: {{- if .Values.proxy.volumes }} {{ toYaml .Values.proxy.volumes | indent 6 }} {{- end}} - + {{- if .Values.volumes }} + {{- toYaml .Values.volumes | nindent 6 }} + {{- end}} {{- end }} diff --git a/charts/milvus/templates/querycoord-deployment.yaml b/charts/milvus/templates/querycoord-deployment.yaml index 3f7b4d7..7d74831 100644 --- a/charts/milvus/templates/querycoord-deployment.yaml +++ b/charts/milvus/templates/querycoord-deployment.yaml @@ -141,6 +141,9 @@ spec: {{- end }} - mountPath: /milvus/tools name: tools + {{- if .Values.volumeMounts }} + {{- toYaml .Values.volumeMounts | nindent 8 }} + {{- end}} {{- if and (.Values.nodeSelector) (not .Values.queryCoordinator.nodeSelector) }} nodeSelector: @@ -182,4 +185,7 @@ spec: {{- end }} - name: tools emptyDir: {} + {{- if .Values.volumes }} + {{- toYaml .Values.volumes | nindent 6 }} + {{- end}} {{- end }} diff --git a/charts/milvus/templates/querynode-deployment.yaml b/charts/milvus/templates/querynode-deployment.yaml index de72586..74052b5 100644 --- a/charts/milvus/templates/querynode-deployment.yaml +++ b/charts/milvus/templates/querynode-deployment.yaml @@ -147,6 +147,9 @@ spec: - mountPath: /var/lib/milvus/data name: disk {{- end }} + {{- if .Values.volumeMounts }} + {{- toYaml .Values.volumeMounts | nindent 8 }} + {{- end}} {{- if and (.Values.nodeSelector) (not .Values.queryNode.nodeSelector) }} nodeSelector: @@ -192,4 +195,7 @@ spec: - name: disk emptyDir: {} {{- end }} + {{- if .Values.volumes }} + {{- toYaml .Values.volumes | nindent 6 }} + {{- end}} {{- end }} diff --git a/charts/milvus/templates/rootcoord-deployment.yaml b/charts/milvus/templates/rootcoord-deployment.yaml index 5bcd2a2..b68d64c 100644 --- a/charts/milvus/templates/rootcoord-deployment.yaml +++ b/charts/milvus/templates/rootcoord-deployment.yaml @@ -141,6 +141,9 @@ spec: {{- end }} - mountPath: /milvus/tools name: tools + {{- if .Values.volumeMounts }} + {{- toYaml .Values.volumeMounts | nindent 8 }} + {{- end}} {{- if and (.Values.nodeSelector) (not .Values.rootCoordinator.nodeSelector) }} nodeSelector: @@ -182,4 +185,7 @@ spec: {{- end }} - name: tools emptyDir: {} + {{- if .Values.volumes }} + {{- toYaml .Values.volumes | nindent 6 }} + {{- end}} {{- end }} diff --git a/charts/milvus/templates/standalone-deployment.yaml b/charts/milvus/templates/standalone-deployment.yaml index d255a20..fdb187d 100644 --- a/charts/milvus/templates/standalone-deployment.yaml +++ b/charts/milvus/templates/standalone-deployment.yaml @@ -143,6 +143,9 @@ spec: - mountPath: /var/lib/milvus/data name: disk {{- end }} + {{- if .Values.volumeMounts }} + {{- toYaml .Values.volumeMounts | nindent 8 }} + {{- end}} {{- if and (.Values.nodeSelector) (not .Values.standalone.nodeSelector) }} nodeSelector: @@ -195,4 +198,7 @@ spec: - name: disk emptyDir: {} {{- end }} + {{- if .Values.volumes }} + {{- toYaml .Values.volumes | nindent 6 }} + {{- end}} {{- end }} diff --git a/charts/milvus/templates/streamingnode-deployment.yaml b/charts/milvus/templates/streamingnode-deployment.yaml index a7a9eee..fe2c634 100644 --- a/charts/milvus/templates/streamingnode-deployment.yaml +++ b/charts/milvus/templates/streamingnode-deployment.yaml @@ -132,6 +132,9 @@ spec: {{- end }} - mountPath: /milvus/tools name: tools + {{- if .Values.volumeMounts }} + {{- toYaml .Values.volumeMounts | nindent 8 }} + {{- end}} {{- if and (.Values.nodeSelector) (not .Values.streamingNode.nodeSelector) }} nodeSelector: @@ -172,4 +175,7 @@ spec: {{- end }} - name: tools emptyDir: {} + {{- if .Values.volumes }} + {{- toYaml .Values.volumes | nindent 6 }} + {{- end}} {{- end }} diff --git a/charts/milvus/values.yaml b/charts/milvus/values.yaml index 179102c..740156a 100644 --- a/charts/milvus/values.yaml +++ b/charts/milvus/values.yaml @@ -44,6 +44,12 @@ affinity: {} labels: {} annotations: {} +# Global Volumes & volumeMounts +# If set, this will apply to all milvus components +# ref: https://kubernetes.io/docs/concepts/storage/volumes/ +volumes: [] +volumeMounts: [] + # Experimental feature: streaming node # Only support standalone mode with rocksmq and pulsar message queue, # cluster mode with pulsar message queue.