milvus
by Milvus
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
- Add the stable repository
$ helm repo add milvus https://milvus-io.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 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 upgradeto 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 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.
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.
| Parameter | Description | Default |
|---|---|---|
cluster.enabled | Enable or disable Milvus Cluster mode | true |
image.all.repository | Image repository | milvusdb/milvus |
image.all.tag | Image tag | v2.2.13 |
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.1 |
image.tools.pullPolicy | Config image pull policy | IfNotPresent |
extraConfigFiles | Extra config to override default milvus.yaml | user.yaml: |
service.type | Service type | ClusterIP |
service.port | Port where service is exposed | 19530 |
service.portName | Useful for Istio protocol selection | milvus |
service.nodePort | Service nodePort | unset |
service.annotations | Service annotations | {} |
service.labels | Service custom labels | {} |
service.clusterIP | Internal cluster service IP | unset |
service.loadBalancerIP | IP address to assign to load balancer (if supported) | unset |
service.loadBalancerSourceRanges | List of IP CIDRs allowed access to lb (if supported) | [] |
service.externalIPs | Service external IP addresses | [] |
ingress.enabled | If true, Ingress will be created | false |
ingress.annotations | Ingress annotations | {} |
ingress.labels | Ingress labels | {} |
ingress.rules | Ingress rules | [] |
ingress.tls | Ingress TLS configuration | [] |
serviceAccount.create | Create a custom service account | false |
serviceAccount.name | Service Account name | milvus |
serviceAccount.annotations | Service Account Annotations | {} |
serviceAccount.labels | Service Account labels | {} |
metrics.enabled | Export Prometheus monitoring metrics | true |
metrics.serviceMonitor.enabled | Create ServiceMonitor for Prometheus operator | false |
metrics.serviceMonitor.additionalLabels | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | unset |
log.level | Logging level to be used. Valid levels are debug, info, warn, error, fatal | info |
log.file.maxSize | The size limit of the log file (MB) | 300 |
log.file.maxAge | The maximum number of days that the log is retained. (day) | 10 |
log.file.maxBackups | The maximum number of retained logs. | 20 |
log.format | Format used for the logs. Valid formats are text and json | text |
log.persistence.enabled | Use persistent volume to store Milvus logs data | false |
log.persistence.mountPath | Milvus logs data persistence volume mount path | /milvus/logs |
log.persistence.annotations | PersistentVolumeClaim annotations | {} |
log.persistence.persistentVolumeClaim.existingClaim | Use your own data Persistent Volume existing claim name | unset |
log.persistence.persistentVolumeClaim.storageClass | The Milvus logs data Persistent Volume Storage Class | unset |
log.persistence.persistentVolumeClaim.accessModes | The Milvus logs data Persistence access modes | ReadWriteOnce |
log.persistence.persistentVolumeClaim.size | The size of Milvus logs data Persistent Volume Storage Class | 5Gi |
log.persistence.persistentVolumeClaim.subPath | SubPath for Milvus logs data mount | unset |
externalS3.enabled | Enable or disable external S3 | false |
externalS3.host | The host of the external S3 | unset |
externalS3.port | The port of the external S3 | unset |
externalS3.rootPath | The path prefix of the external S3 | unset |
externalS3.accessKey | The Access Key of the external S3 | unset |
externalS3.secretKey | The Secret Key of the external S3 | unset |
externalS3.bucketName | The Bucket Name of the external S3 | unset |
externalS3.useSSL | If true, use SSL to connect to the external S3 | false |
externalS3.useIAM | If true, use iam to connect to the external S3 | false |
externalS3.cloudProvider | When useIAM enabled, only "aws" & "gcp" is supported for now | aws |
externalS3.iamEndpoint | The |
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 v4.0.31 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