Disable ml commons plugin in opensearch

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
We are running OpenSearch/Dashboard in Kubernetes cluster

OpenSearch/Dashboard version: v 2.9.0

K8s cluster version: 1.26.5

Describe the issue:

We do not need this ml-commons plugin in our environment, so we need to know how to disable it permanently in all opensearch cluster nodes

There’s no static config or dynamic setting can be used to disable ml plugin, you can remove it manually by this:

./bin/opensearch-plugin remove opensearch-ml

understood but if I’m running OpenSearch on Kubernetes, whenever the pod is re-created, the plugin would be back again. right?

Yes, in this case you’d better make your own image.

@Mamdouh You can also try using an init container that will remove the plugin from the OpenSearch pod before deploying it. That way you’ll avoid building a custom image.

Alternatively, if you just looking to disable ML in OpenSearch Dashboards you can disable it through opensearch_dashbaords.yml by setting:

ml_commons_dashboards.enabled: false