milvus
by Zilliz
Milvus is an open-source vector database built to power AI applications and vector similarity search.
About this chart
Milvus Helm Chart
For more information about installing and using Helm, see the Helm Docs. For a quick introduction to Charts, see the Chart Guide.
Introduction
This chart bootstraps Milvus deployment on a Kubernetes cluster using the Helm package manager.
Prerequisites
- Kubernetes >= 1.20.0
- Helm >= 3.14.0
Compatibility Notice
-
IMPORTANT As of helm version 5.0.0, significant architectural changes have been introduced in Milvus v2.6.0:
- Coordinator consolidation: Legacy separate coordinators (dataCoord, queryCoord, indexCoord) have been consolidated into a single mixCoord
- New components: Introduction of Streaming Node for enhanced data processing
- Component removal: indexNode has been removed and consolidated
- Milvus v2.6.0-rc1 is not compatible with v2.6.x. Direct upgrades from release candidates are not supported.
- You must upgrade to v2.5.16 with mixCoordinator enabled before upgrading to v2.6.x.
-
IMPORTANT For users using pulsar2. Please don't use version 4.2.21~4.2.29 for upgrading, there're some known issues. 4.2.30 or later version is recommended. Remember to add
--set pulsar.enabled=true,pulsarv3.enabled=falseor set them in your values file when upgrading. -
As of version 4.2.21, the Milvus Helm chart introduced pulsar-v3.x chart as dependency. For backward compatibility, please upgrade your helm to v3.14 or later version, and be sure to add the
--reset-then-reuse-valuesoption whenever you usehelm upgrade. -
As of version 4.2.0, the Milvus Helm chart no longer supports Milvus v2.3.x. If you need to deploy Milvus v2.3.x using Helm, please use Milvus Helm chart version less than 4.2.0 (e.g 4.1.36).
IMPORTANT The master branch is for the development of Milvus v2.x. On March 9th, 2021, we released Milvus v1.0, the first stable version of Milvus with long-term support. To use Milvus v1.x, switch to branch 1.1.
Install the Chart
- Add the stable repository
$ helm repo add zilliztech https://zilliztech.github.io/milvus-helm/
- Update charts repositories
$ helm repo update
Deploy Milvus with standalone mode
Assume the release name is my-release:
# Helm v3.x
$ helm upgrade --install my-release --set cluster.enabled=false --set etcd.replicaCount=1 --set pulsarv3.enabled=false --set minio.mode=standalone zilliztech/milvus
By default, milvus standalone uses woodpecker as message queue. You can also use pulsar or kafka as message queue:
# Helm v3.x
# Milvus Standalone with pulsar as message queue
$ helm upgrade --install my-release --set cluster.enabled=false --set standalone.messageQueue=pulsar --set etcd.replicaCount=1 --set pulsarv3.enabled=true --set minio.mode=standalone zilliztech/milvus
# Helm v3.x
# Milvus Standalone with kafka as message queue
$ helm upgrade --install my-release --set cluster.enabled=false --set standalone.messageQueue=kafka --set etcd.replicaCount=1 --set pulsarv3.enabled=false --set kafka.enabled=true --set minio.mode=standalone zilliztech/milvus
If you need to use standalone mode with embedded ETCD and local storage (without starting MinIO and additional ETCD), you can use the following steps:
- Prepare a values file
cat > values.yaml <<EOF
---
cluster:
enabled: false
etcd:
enabled: false
pulsarv3:
enabled: false
minio:
enabled: false
tls:
enabled: false
extraConfigFiles:
user.yaml: |+
etcd:
use:
embed: true
data:
dir: /var/lib/milvus/etcd
common:
storageType: local
EOF
- Helm install with this values file
helm upgrade --install -f values.yaml my-release zilliztech/milvus
Tip: To list all releases, using
helm list.
Deploy Milvus with cluster mode
Assume the release name is my-release:
# Helm v3.x
$ helm upgrade --install my-release zilliztech/milvus
By default, milvus cluster uses pulsar as message queue. You can also use kafka instead of pulsar for milvus cluster:
# Helm v3.x
$ helm upgrade --install my-release zilliztech/milvus --set pulsarv3.enabled=false --set kafka.enabled=true
By default, milvus cluster uses mixCoordinator which contains all coordinators. This is the recommended deployment approach for Milvus v2.6.x and later versions.
Upgrading from Milvus v2.5.x to v2.6.x
Upgrading from Milvus 2.5.x to 2.6.x involves significant architectural changes. Please follow these steps carefully:
Requirements
System requirements:
- Helm version >= 3.14.0
- Kubernetes version >= 1.20.0
- Milvus cluster deployed via Helm Chart
Compatibility requirements:
- Milvus v2.6.0-rc1 is not compatible with v2.6.x. Direct upgrades from release candidates are not supported.
- If you are currently running v2.6.0-rc1 and need to preserve your data, please refer to community guides for migration assistance.
- You must upgrade to v2.5.16 with mixCoordinator enabled before upgrading to v2.6.x.
Upgrade Process
Step 1: Upgrade Helm Chart
First, upgrade your Milvus Helm chart repository:
helm repo add zilliztech https://zilliztech.github.io/milvus-helm
helm repo update zilliztech
Step 2: Upgrade to v2.5.16 with mixCoordinator
Check if your cluster currently uses separate coordinators:
kubectl get pods
If you see separate coordinator pods (datacoord, querycoord, indexcoord), upgrade to v2.5.16 and enable mixCoordinator:
helm upgrade my-release zilliztech/milvus \
--set image.all.tag="v2.5.16" \
--set mixCoordinator.enabled=true \
--set rootCoordinator.enabled=false \
--set indexCoordinator.enabled=false \
--set queryCoordinator.enabled=false \
--set dataCoordinator.enabled=false \
--reset-then-reuse-values \
--version=4.2.58
If your cluster already uses mixCoordinator, simply upgrade the image:
helm upgrade my-release zilliztech/milvus \
--set image.all.tag="v2.5.16" \
--reset-then-reuse-values \
--version=4.2.58
Step 3: Upgrade to v2.6.x
Once v2.5.16 is running successfully with mixCoordinator, upgrade to v2.6.x:
helm upgrade my-release zilliztech/milvus \
--set image.all.tag="v2.6.x" \
--set streaming.enabled=true \
--set indexNode.enabled=false \
--reset-then-reuse-values \
--version=5.0.0
Upgrade an existing Milvus cluster (General)
IMPORTANT If you have installed a milvus cluster with version below v2.1.x, you need follow the instructions at here: https://github.com/milvus-io/milvus/blob/master/deployments/migrate-meta/README.md. After meta migration, you use
helm upgradeto update your cluster again.
E.g. to scale out query node from 1(default) to 2:
# Helm v3.14.0+
$ helm upgrade --reset-then-reuse-values --install --set queryNode.replicas=2 my-release zilliztech/milvus
Milvus Mix Coordinator Active Standby
IMPORTANT Milvus supports deploying multiple Mix Coordinator instances for high availability. For example, you can run a Milvus cluster with two mixcoord pods:
helm upgrade --install my-release zilliztech/milvus --set mixCoordinator.activeStandby.enabled=true --set mixCoordinator.replicas=2
Breaking Changes
IMPORTANT Milvus helm chart 4.0.0 has breaking changes for milvus configuration. Previously, you can set segment size like this
--set dataCoordinator.segment.maxSize=1024. Now we have remove all the shortcut config option. Instead, you can set usingextraConfigFileslike this:
extraConfigFiles:
user.yaml: |+
dataCoord:
segment:
maxSize: 1024
So if you had deployed a cluster with helm chart version below 4.0.0 and also specified extra config, you need set the configs under extraConfigFiles when running helm upgrade.
IMPORTANT Milvus has removed mysql as meta store support from v2.3.1. And milvus helm chart has also removed mysql as dependency from chart version 4.1.8.
Enable log to file
By default, all the logs of milvus components will output stdout. If you wanna log to file, you'd install milvus with --set log.persistence.enabled=true. Note that you should have a storageclass with ReadWriteMany access modes.
# Install a milvus cluster with file log output
helm install my-release zilliztech/milvus --set log.persistence.enabled=true --set log.persistence.persistentVolumeClaim.storageClass=<read-write-many-storageclass>
It will output log to /milvus/logs/ directory.
Enable proxy tls connection
By default the TLS connection to proxy service is false, to enable TLS with users' own certificate and privatge key, it can be specified in extraConfigFiles like this:
extraConfigFiles:
user.yaml: |+
# Enable tlsMode and set the tls cert and key
tls:
serverPemPath: /etc/milvus/certs/tls.crt
serverKeyPath: /etc/milvus/certs/tls.key
common:
security:
tlsMode: 1
The path specified above are TLS secret data mounted inside the proxy pod as files. To create a TLS secret, set proxy.tls.enabled to true then provide base64-encoded values for your certificate and private key files in values.yaml:
proxy:
enabled: true
tls:
enabled: true
secretName: milvus-tls
#expecting base64 encoded values here: i.e. $(cat tls.crt | base64 -w 0) and $(cat tls.key | base64 -w 0)
key: LS0tLS1C....
crt: LS0tLS1CR...
or in cli using --set:
--set proxy.tls.enabled=true \
--set prox.tls.key=$(cat /path/to/private_key_file | base64 -w 0) \
--set prox.tls.crt=$(cat /path/to/certificate_file | base64 -w 0)
In case you want to use a different secretName or mount path inside pod, modify prox.tls.secretName above, and serverPemPath and serverPemPath in extraConfigFles accordingly, then in the volume and volumeMounts sections in values.yaml
volumes:
- secret:
secretName: Your-tls-secret-name
name: milvus-tls
volumeMounts:
- mountPath: /Your/tls/files/path/
name: milvus-tls
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.
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:
minio:
enabled: false
externalS3:
enabled: true
cloudProvider: aws
host: s3.aws.com
port: 443
useSSL: true
bucketName: <bucket-name>
accessKey: <s3-access-key>
secretKey: <s3-secret-key>
Uninstall the Chart
# Helm v3.x
$ helm uninstall my-release
The command removes all the Kubernetes components associated with the chart and deletes the release.
- Completely uninstall Milvus
IMPORTANT Please run this command with care. Maybe you want to keep ETCD data
MILVUS_LABELS="app.kubernetes.io/instance=my-release"
kubectl delete pvc $(kubectl get pvc -l "${MILVUS_LABELS}" -o jsonpath='{range.items[*]}{.metadata.name} ')
Configuration
Milvus Service Configuration
The following table lists the configurable parameters of the Milvus Service and their default values.
| Parameter | Description | Default |
|---|---|---|
cluster.enabled | Enable or disable Milvus Cluster mode | true |
route.enabled | Enable OpenShift route | false |
route.hostname | Hostname for the OpenShift route | "" |
route.path | Path for the OpenShift route | "" |
route.termination | TLS termination for the route | edge |
route.annotations | Route annotations | {} |
route.labels | Route labels | {} |
image.all.repository | Image repository | milvusdb/milvus |
image.all.tag | Image tag | v3.0.6 |
image.all.pullPolicy | Image pull policy | IfNotPresent |
image.all.pullSecrets | Image pull secrets | {} |
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 |
Deploy milvus with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has milvus on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartmilvus is pinned at v5.0.34 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply