Upgrade Milvus Cluster with Helm Chart
This guide describes how to upgrade your Milvus cluster with Milvus Helm charts.
Check Milvus Helm Chart
Run the following commands to check new Milvus versions.
$ helm repo update
$ helm search repo zilliztech/milvus --versions
The Milvus Helm Charts repo at https://milvus-io.github.io/milvus-helm/
has been archived and you can get further updates from https://zilliztech.github.io/milvus-helm/
as follows:
helm repo add zilliztech https://zilliztech.github.io/milvus-helm
helm repo update
# upgrade existing helm release
helm upgrade my-release zilliztech/milvus
The archived repo is still available for the charts up to 4.0.31. For later releases, use the new repo instead.
NAME CHART VERSION APP VERSION DESCRIPTION
zilliztech/milvus 4.1.28 2.3.13 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.27 2.3.12 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.26 2.3.12 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.25 2.3.12 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.24 2.3.11 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.23 2.3.10 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.22 2.3.10 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.21 2.3.10 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.20 2.3.10 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.19 2.3.10 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.18 2.3.9 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.17 2.3.8 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.16 2.3.7 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.15 2.3.5 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.14 2.3.6 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.13 2.3.5 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.12 2.3.5 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.11 2.3.4 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.10 2.3.3 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.9 2.3.3 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.8 2.3.2 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.7 2.3.2 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.6 2.3.1 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.5 2.3.1 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.4 2.3.1 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.3 2.3.1 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.2 2.3.1 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.1 2.3.0 Milvus is an open-source vector database built ...
zilliztech/milvus 4.1.0 2.3.0 Milvus is an open-source vector database built ...
You can choose the upgrade path for your Milvus as follows:
- Conduct a rolling upgrade from Milvus v2.2.3 and later releases to v2.3.21.
- Upgrade Milvus using Helm for an upgrade from a minor release before v2.2.3 to v2.3.21.
- Migrate the metadata before the upgrade from Milvus v2.1.x to v2.3.21.
Upgrade Milvus using Helm
To upgrade Milvus from a minor release before v2.2.3 to the latest, run the following commands:
helm repo update
helm upgrade my-release zilliztech/milvus --reuse-values --version=4.1.28 # use the helm chart version here
Use the Helm chart version in the preceding command. For details on how to obtain the Helm chart version, refer to Check the Milvus version.
Migrate the metadata
Since Milvus 2.2.0, the metadata is incompatible with that in previous releases. The following example snippets assume an upgrade from Milvus 2.1.4 to Milvus 2.2.0.
1. Check the Milvus version
Run $ helm list
to check your Milvus app version. You can see the APP VERSION
is 2.1.4.
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
new-release default 1 2022-11-21 15:41:25.51539 +0800 CST deployed milvus-3.2.18 2.1.4
2. Check the running pods
Run $ kubectl get pods
to check the running pods. You can see the following output.
NAME READY STATUS RESTARTS AGE
my-release-etcd-0 1/1 Running 0 21m
my-release-etcd-1 1/1 Running 0 21m
my-release-etcd-2 1/1 Running 0 21m
my-release-milvus-datacoord-664c58798d-fl75s 1/1 Running 0 21m
my-release-milvus-datanode-5f75686c55-xfg2r 1/1 Running 0 21m
my-release-milvus-indexcoord-5f98b97589-2l48r 1/1 Running 0 21m
my-release-milvus-indexnode-857b4ddf98-vmd75 1/1 Running 0 21m
my-release-milvus-proxy-6c548f787f-scspp 1/1 Running 0 21m
my-release-milvus-querycoord-c454f44cd-dwmwq 1/1 Running 0 21m
my-release-milvus-querynode-76bb4946d-lbrz6 1/1 Running 0 21m
my-release-milvus-rootcoord-7764c5b686-62msm 1/1 Running 0 21m
my-release-minio-0 1/1 Running 0 21m
my-release-minio-1 1/1 Running 0 21m
my-release-minio-2 1/1 Running 0 21m
my-release-minio-3 1/1 Running 0 21m
my-release-pulsar-bookie-0 1/1 Running 0 21m
my-release-pulsar-bookie-1 1/1 Running 0 21m
my-release-pulsar-bookie-2 1/1 Running 0 21m
my-release-pulsar-bookie-init-tjxpj 0/1 Completed 0 21m
my-release-pulsar-broker-0 1/1 Running 0 21m
my-release-pulsar-proxy-0 1/1 Running 0 21m
my-release-pulsar-pulsar-init-c8vvc 0/1 Completed 0 21m
my-release-pulsar-recovery-0 1/1 Running 0 21m
my-release-pulsar-zookeeper-0 1/1 Running 0 21m
my-release-pulsar-zookeeper-1 1/1 Running 0 20m
my-release-pulsar-zookeeper-2 1/1 Running 0 20m
3. Check the image tag
Check the image tag for the pod my-release-milvus-proxy-6c548f787f-scspp
. You can see the release of your Milvus cluster is v2.1.4.
$ kubectl get pods my-release-milvus-proxy-6c548f787f-scspp -o=jsonpath='{$.spec.containers[0].image}'
# milvusdb/milvus:v2.1.4
4. Migrate the metadata
A major change in Milvus 2.2 is the metadata structure of segment indexes. Therefore, you need to use Helm to migrate the metadata while upgrading Milvus from v2.1.x to v2.2.0. Here is a script for you to safely migrate your metadata.
This script only applies to Milvus installed on a K8s cluster. Roll back to the previous version with the rollback operation first if an error occurs during the process.
The following table lists the operations you can do for meta migration.
Parameters | Description | Default value | Required |
---|---|---|---|
i | The Milvus instance name. | None | True |
n | The namespace that Milvus is installed in. | default | False |
s | The source Milvus version. | None | True |
t | The target Milvus version. | None | True |
r | The root path of Milvus meta. | by-dev | False |
w | The new Milvus image tag. | milvusdb/milvus:v2.2.0 | False |
m | The meta migration image tag. | milvusdb/meta-migration:v2.2.0 | False |
o | The meta migration operation. | migrate | False |
d | Whether to delete migration pod after the migration is completed. | false | False |
c | The storage class for meta migration pvc. | default storage class | False |
e | The etcd enpoint used by milvus. | etcd svc installed with milvus | False |
1. Migrate the metadata
- Download the migration script.
- Stop the Milvus components. Any live session in the Milvus etcd can cause a migration failure.
- Create a backup for the Milvus metadata.
- Migrate the Milvus metadata.
- Start Milvus components with a new image.
2. Upgrade Milvus from v2.1.x to 2.3.21
The following commands assume that you upgrade Milvus from v2.1.4 to 2.3.21. Change them to the versions that fit your needs.
Specify Milvus instance name, source Milvus version, and target Milvus version.
./migrate.sh -i my-release -s 2.1.4 -t 2.3.21
Specify the namespace with
-n
if your Milvus is not installed in the default K8s namespace../migrate.sh -i my-release -n milvus -s 2.1.4 -t 2.3.21
Specify the root path with
-r
if your Milvus is installed with the customrootpath
../migrate.sh -i my-release -n milvus -s 2.1.4 -t 2.3.21 -r by-dev
Specify the image tag with
-w
if your Milvus is installed with a customimage
../migrate.sh -i my-release -n milvus -s 2.1.4 -t 2.3.21 -r by-dev -w milvusdb/milvus:v2.3.21
Set
-d true
if you want to automatically remove the migration pod after the migration is completed../migrate.sh -i my-release -n milvus -s 2.1.4 -t 2.3.21 -w milvusdb/milvus:v2.3.21 -d true
Rollback and migrate again if the migration fails.
./migrate.sh -i my-release -n milvus -s 2.1.4 -t 2.3.21 -r by-dev -o rollback -w milvusdb/milvus:v2.1.1 ./migrate.sh -i my-release -n milvus -s 2.1.4 -t 2.3.21 -r by-dev -o migrate -w milvusdb/milvus:v2.3.21