milvus

by Milvus

Helm chartv4.0.31App 2.2.13

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.

To install Milvus, refer to Milvus installation.

Introduction

This chart bootstraps Milvus deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

  • Kubernetes 1.14+ (Attu requires 1.18+)
  • Helm >= 3.2.0

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

  1. Add the stable repository
$ helm repo add milvus https://milvus-io.github.io/milvus-helm/
  1. 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 pulsar.enabled=false --set minio.mode=standalone milvus/milvus

By default, milvus standalone uses rocksmq 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 pulsar.enabled=true --set minio.mode=standalone milvus/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 pulsar.enabled=false --set kafka.enabled=true --set minio.mode=standalone milvus/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 milvus/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 milvus/milvus --set pulsar.enabled=false --set kafka.enabled=true

By default, milvus cluster uses several separate coordinators. You can also use mixCoordinator instead which contains all coordinators.

# Helm v3.x
$ cat << EOF > values-custom.yaml
mixCoordinator:
  enabled: true
rootCoordinator:
  enabled: false
indexCoordinator:
  enabled: false
queryCoordinator:
  enabled: false
dataCoordinator:
  enabled: false
EOF
$ helm upgrade --install my-release milvus/milvus -f values-custom.yaml

Upgrade an existing Milvus cluster

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 upgrade to update your cluster again.

E.g. to scale out query node from 1(default) to 2:

# Helm v3.x
$ helm upgrade --install --set queryNode.replicas=2 my-release milvus/milvus

Milvus Coordinator Active Standby

IMPORTANT Milvus helm chart 4.0.7 (Milvus 2.2.3) support deploying multiple coordinators. For example, you run a Milvus cluster with two rootcoord pods:

helm upgrade --install my-release milvus/milvus --set rootCoordinator.activeStandby.enabled=true --set rootCoordinator.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 using extraConfigFiles like 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.

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 milvus/milvus --set log.persistence.enabled=true --set log.persistence.persistentVolumeClaim.storageClass=<read-write-many-storageclass>

It will output log to /milvus/logs/ directory.

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.

ParameterDescriptionDefault
cluster.enabledEnable or disable Milvus Cluster modetrue
image.all.repositoryImage repositorymilvusdb/milvus
image.all.tagImage tagv2.2.13
image.all.pullPolicyImage pull policyIfNotPresent
image.all.pullSecretsImage pull secrets{}
image.tools.repositoryConfig image repositorymilvusdb/milvus-config-tool
image.tools.tagConfig image tagv0.1.1
image.tools.pullPolicyConfig image pull policyIfNotPresent
extraConfigFilesExtra config to override default milvus.yamluser.yaml:
service.typeService typeClusterIP
service.portPort where service is exposed19530
service.portNameUseful for Istio protocol selectionmilvus
service.nodePortService nodePortunset
service.annotationsService annotations{}
service.labelsService custom labels{}
service.clusterIPInternal cluster service IPunset
service.loadBalancerIPIP address to assign to load balancer (if supported)unset
service.loadBalancerSourceRangesList of IP CIDRs allowed access to lb (if supported)[]
service.externalIPsService external IP addresses[]
ingress.enabledIf true, Ingress will be createdfalse
ingress.annotationsIngress annotations{}
ingress.labelsIngress labels{}
ingress.rulesIngress rules[]
ingress.tlsIngress TLS configuration[]
serviceAccount.createCreate a custom service accountfalse
serviceAccount.nameService Account namemilvus
serviceAccount.annotationsService Account Annotations{}
serviceAccount.labelsService Account labels{}
metrics.enabledExport Prometheus monitoring metricstrue
metrics.serviceMonitor.enabledCreate ServiceMonitor for Prometheus operatorfalse
metrics.serviceMonitor.additionalLabelsAdditional labels that can be used so ServiceMonitor will be discovered by Prometheusunset
log.levelLogging level to be used. Valid levels are debug, info, warn, error, fatalinfo
log.file.maxSizeThe size limit of the log file (MB)300
log.file.maxAgeThe maximum number of days that the log is retained. (day)10
log.file.maxBackupsThe maximum number of retained logs.20
log.formatFormat used for the logs. Valid formats are text and jsontext
log.persistence.enabledUse persistent volume to store Milvus logs datafalse
log.persistence.mountPathMilvus logs data persistence volume mount path/milvus/logs
log.persistence.annotationsPersistentVolumeClaim annotations{}
log.persistence.persistentVolumeClaim.existingClaimUse your own data Persistent Volume existing claim nameunset
log.persistence.persistentVolumeClaim.storageClassThe Milvus logs data Persistent Volume Storage Classunset
log.persistence.persistentVolumeClaim.accessModesThe Milvus logs data Persistence access modesReadWriteOnce
log.persistence.persistentVolumeClaim.sizeThe size of Milvus logs data Persistent Volume Storage Class5Gi
log.persistence.persistentVolumeClaim.subPathSubPath for Milvus logs data mountunset
externalS3.enabledEnable or disable external S3false
externalS3.hostThe host of the external S3unset
externalS3.portThe port of the external S3unset
externalS3.rootPathThe path prefix of the external S3unset
externalS3.accessKeyThe Access Key of the external S3unset
externalS3.secretKeyThe Secret Key of the external S3unset
externalS3.bucketNameThe Bucket Name of the external S3unset
externalS3.useSSLIf true, use SSL to connect to the external S3false
externalS3.useIAMIf true, use iam to connect to the external S3false
externalS3.cloudProviderWhen useIAM enabled, only "aws" & "gcp" is supported for nowaws
externalS3.iamEndpointThe

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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartmilvus is pinned at v4.0.31 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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