diff --git a/charts/opensearch-dashboards/templates/deployment.yaml b/charts/opensearch-dashboards/templates/deployment.yaml index f1d4916a..0103754b 100644 --- a/charts/opensearch-dashboards/templates/deployment.yaml +++ b/charts/opensearch-dashboards/templates/deployment.yaml @@ -169,6 +169,9 @@ spec: - | #!/usr/bin/bash set -e + {{- range $plugin := .Values.plugins.removeList }} + ./bin/opensearch-dashboards-plugin remove {{ $plugin }} + {{- end }} {{- range $plugin := .Values.plugins.installList }} ./bin/opensearch-dashboards-plugin install {{ $plugin }} {{- end }} diff --git a/charts/opensearch-dashboards/values.yaml b/charts/opensearch-dashboards/values.yaml index 524031b4..096c9c01 100644 --- a/charts/opensearch-dashboards/values.yaml +++ b/charts/opensearch-dashboards/values.yaml @@ -274,3 +274,5 @@ plugins: enabled: false installList: [] # - example-fake-plugin-downloadable-url + removeList: [] + # - securityDashboards diff --git a/charts/opensearch/templates/statefulset.yaml b/charts/opensearch/templates/statefulset.yaml index 72e14976..dff761dc 100644 --- a/charts/opensearch/templates/statefulset.yaml +++ b/charts/opensearch/templates/statefulset.yaml @@ -360,6 +360,12 @@ spec: #!/usr/bin/env bash set -euo pipefail + {{- range $plugin := .Values.plugins.removeList }} + if ./bin/opensearch-plugin list | grep -q {{ $plugin }}; then + ./bin/opensearch-plugin remove {{ $plugin }} + fi + {{- end }} + {{- range $plugin := .Values.plugins.installList }} ./bin/opensearch-plugin install -b {{ $plugin }} {{- end }} diff --git a/charts/opensearch/values.yaml b/charts/opensearch/values.yaml index 33737661..c6fd760d 100644 --- a/charts/opensearch/values.yaml +++ b/charts/opensearch/values.yaml @@ -489,6 +489,8 @@ plugins: enabled: false installList: [] # - example-fake-plugin + removeList: [] + # - opensearch-ml # -- Array of extra K8s manifests to deploy extraObjects: []