New to KubeDB? Please start here.

Vertical Scaling Milvus

This guide will show you how to use the KubeDB Ops-manager operator to update the resources (CPU/memory) of a Milvus database.

Before You Begin

Note: The yaml files used in this tutorial are stored in docs/guides/milvus/scaling/vertical-scaling/yamls folder in GitHub repository kubedb/docs.

Vertical Scaling Standalone Milvus

Deploy a standalone Milvus and wait until it is Ready. By default the standalone workload requests cpu: 500m / memory: 1Gi:

$ kubectl get petset milvus-standalone -n demo -o jsonpath='{.spec.template.spec.containers[0].resources}'
{"limits":{"memory":"1Gi"},"requests":{"cpu":"500m","memory":"1Gi"}}

Apply the VerticalScaling OpsRequest

vertical-scaling-standalone.yaml

apiVersion: ops.kubedb.com/v1alpha1
kind: MilvusOpsRequest
metadata:
  name: vertical-scaling-standalone
  namespace: demo
spec:
  type: VerticalScaling
  databaseRef:
    name: milvus-standalone
  verticalScaling:
    node:
      resources:
        requests:
          memory: "2Gi"
          cpu: "1"
        limits:
          memory: "2Gi"
          cpu: "1"
  timeout: 5m
  apply: IfReady

Here, spec.verticalScaling.node carries the new resources for the standalone workload (use the node key for standalone).

$ kubectl apply -f https://github.com/kubedb/docs/raw/v2026.6.19/docs/guides/milvus/scaling/vertical-scaling/yamls/vertical-scaling-standalone.yaml
milvusopsrequest.ops.kubedb.com/vertical-scaling-standalone created

Watch Progress

$ kubectl get milvusopsrequest vertical-scaling-standalone -n demo
NAME                          TYPE              STATUS       AGE
vertical-scaling-standalone   VerticalScaling   Successful   56s
$ kubectl describe milvusopsrequest vertical-scaling-standalone -n demo
...
Status:
  Conditions:
    Message:  Milvus ops-request has started to vertically scale the Milvus nodes
    Reason:   VerticalScaling
    Type:     VerticalScaling
    Message:  Successfully updated PetSets Resources
    Reason:   UpdatePetSets
    Type:     UpdatePetSets
    Message:  check pod running; ConditionStatus:True; PodName:milvus-standalone-0
    Type:     CheckPodRunning--milvus-standalone-0
    Message:  Successfully Restarted Pods With Resources
    Reason:   RestartPods
    Type:     RestartPods
    Message:  Successfully completed the vertical scaling for Milvus
    Reason:   Successful
    Type:     Successful
  Phase:      Successful

Verify the New Resources

Both the Milvus spec and the PetSet pod template now carry the new resources:

$ kubectl get milvuses.kubedb.com milvus-standalone -n demo -o jsonpath='{.spec.podTemplate.spec.containers[0].resources}'
{"limits":{"cpu":"1","memory":"2Gi"},"requests":{"cpu":"1","memory":"2Gi"}}

$ kubectl get petset milvus-standalone -n demo -o jsonpath='{.spec.template.spec.containers[0].resources}'
{"limits":{"cpu":"1","memory":"2Gi"},"requests":{"cpu":"1","memory":"2Gi"}}

Vertical Scaling Distributed Milvus

For a distributed Milvus, set the resources per role under spec.verticalScaling. You can scale several roles in a single OpsRequest. The sample below scales mixcoord and proxy:

vertical-scaling-distributed.yaml

apiVersion: ops.kubedb.com/v1alpha1
kind: MilvusOpsRequest
metadata:
  name: vertical-scaling
  namespace: demo
spec:
  type: VerticalScaling
  databaseRef:
    name: milvus-cluster
  verticalScaling:
    mixcoord:
      resources:
        requests:
          memory: "2Gi"
          cpu: "1"
        limits:
          memory: "2Gi"
          cpu: "1"
    proxy:
      resources:
        requests:
          memory: "2Gi"
          cpu: "1"
        limits:
          memory: "2Gi"
          cpu: "1"
  timeout: 5m
  apply: IfReady

The same approach applies to datanode, querynode and streamingnode.

$ kubectl apply -f https://github.com/kubedb/docs/raw/v2026.6.19/docs/guides/milvus/scaling/vertical-scaling/yamls/vertical-scaling-distributed.yaml
milvusopsrequest.ops.kubedb.com/vertical-scaling created

$ kubectl get milvusopsrequest vertical-scaling -n demo
NAME               TYPE              STATUS       AGE
vertical-scaling   VerticalScaling   Successful   36s

Both the mixcoord and proxy PetSets now carry the new resources (other roles are unchanged):

$ kubectl get petset milvus-cluster-mixcoord -n demo -o jsonpath='{.spec.template.spec.containers[0].resources}'
{"limits":{"cpu":"1","memory":"2Gi"},"requests":{"cpu":"1","memory":"2Gi"}}

$ kubectl get petset milvus-cluster-proxy -n demo -o jsonpath='{.spec.template.spec.containers[0].resources}'
{"limits":{"cpu":"1","memory":"2Gi"},"requests":{"cpu":"1","memory":"2Gi"}}

Cleaning up

$ kubectl delete milvusopsrequest -n demo vertical-scaling-standalone
$ kubectl delete milvus.kubedb.com -n demo milvus-standalone
$ kubectl delete ns demo

Next Steps