milvus-operator icon indicating copy to clipboard operation
milvus-operator copied to clipboard

[Feature] Support for custom `runtimeClassName` on Milvus instances

Open gruberdev opened this issue 2 years ago • 1 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Is your feature request related to a problem? Please describe.

The Milvus operator currently lacks the ability to set a custom RuntimeClassName in the Kubernetes Deployment objects it manages. This parameter is crucial for specifying the container runtime configuration, especially when deploying on GPU nodes that can leverage them with Milvus v2.3 newly introduced GPU indexing acceleration.

Describe the solution you'd like.

To implement this feature, a new field can be added to the ComponentSpec struct to hold the RuntimeClassName.

// +kubebuilder:validation:Optional
RuntimeClassName string `json:"runtimeClassName,omitempty"`

Then, in the updatePodTemplate function within deployment_updater.go, the RuntimeClassName can be set like so:

template.Spec.RuntimeClassName = &yourRuntimeClassName

This change allows users to specify a custom runtime class through the Milvus custom resource, thereby enabling more fine-grained control over the runtime environment.

Describe an alternate solution.

Another approach could be to use a mutating admission webhook that intercepts the Deployment objects created by the Milvus operator. The webhook could then modify the RuntimeClassName field before the object is actually committed to the Kubernetes API server. Albeit suboptimal, it could still be a strategy to implement this feature, given it is not a common configuration.

Anything else? (Additional Context)

Setting a custom RuntimeClassName is particularly important for deployments that require specialized runtime environments, such as those interacting with Kubernetes nodes equipped with GPUs.

gruberdev avatar Sep 17 '23 04:09 gruberdev

Sry for the delay. It looks good, would you like to contribute a PR ?

haorenfsa avatar Sep 28 '23 13:09 haorenfsa