Skip to content

Delete OpenSearch

This page guides you through the steps required to delete an OpenSearch instance.

Prerequisites

Steps

List OpenSearch instances

To list all OpenSearch instances belonging to your team:

Through the Nais Console

  1. Open Nais Console in your browser and select your team.
  2. Select the OpenSearch tab
  3. Find the name of the OpenSearch instance you want to delete

Using Kubectl

kubectl get opensearches

Disable termination protection

Before your can delete a specific OpenSearch instance, you must first disable termination protection.

To disable termination protection, run the following command:

kubectl patch openSearch <OPENSEARCH-NAME> \
  --type json \
  -p='[{"op": "replace", "path": "/spec/terminationProtection", "value": false}]'

Remove references from application manifests

Ensure that all references to the OpenSearch instance are removed from your application manifests:

app.yaml
spec:
-  openSearch:
-    - instance: <OPENSEARCH-INSTANCE-NAME>
-      access: <ACCESS-LEVEL>

Delete OpenSearch instance

To delete the OpenSearch instance, run the following command:

kubectl delete openSearch <OPENSEARCH-NAME>