Skip to content

Delete OpenSearchΒΆ

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

PrerequisitesΒΆ

StepsΒΆ

Before you delete a OpenSearch instance, ensure that no applications are using it. If you delete a OpenSearch instance in use, the applications will lose access to the data stored in the instance. Deletion of a OpenSearch instance can only be done through the terminal.

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 openSearchs

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}]'

Delete OpenSearch instanceΒΆ

To delete the OpenSearch instance, run the following command:

kubectl delete openSearch <OPENSEARCH-NAME>

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>