Run OpenSearch Dashboards using Helm

Helm is a package manager that allows you to easily install and manage OpenSearch Dashboards in a Kubernetes cluster. You can define your OpenSearch configurations in a YAML file and use Helm to deploy your applications in a version-controlled and reproducible way.

The Helm chart contains the resources described in the following table.

ResourceDescription
Chart.yamlInformation about the chart.
values.yamlDefault configuration values for the chart.
templatesTemplates that combine with values to generate the Kubernetes manifest files.

The specification in the default Helm chart supports many standard use cases and setups. You can modify the default chart to configure your desired specifications and set Transport Layer Security (TLS) and role-based access control (RBAC).

For information about the default configuration, steps to configure security, and configurable parameters, see the README.

The instructions here assume you have a Kubernetes cluster with Helm preinstalled. See the Kubernetes documentation for steps to configure a Kubernetes cluster and the Helm documentation to install Helm.

Prerequisites

Before you get started, you must first use Helm to install OpenSearch.

Make sure that you can send requests to your OpenSearch pod:

  1. $ curl -XGET https://localhost:9200 -u 'admin:admin' --insecure
  2. {
  3. "name" : "opensearch-cluster-master-1",
  4. "cluster_name" : "opensearch-cluster",
  5. "cluster_uuid" : "hP2gq5bPS3SLp8Z7wXm8YQ",
  6. "version" : {
  7. "distribution" : "opensearch",
  8. "number" : "1.0.0",
  9. "build_type" : "tar",
  10. "build_hash" : "34550c5b17124ddc59458ef774f6b43a086522e3",
  11. "build_date" : "2021-07-02T23:22:21.383695Z",
  12. "build_snapshot" : false,
  13. "lucene_version" : "8.8.2",
  14. "minimum_wire_compatibility_version" : "6.8.0",
  15. "minimum_index_compatibility_version" : "6.0.0-beta1"
  16. },
  17. "tagline" : "The OpenSearch Project: https://opensearch.org/"
  18. }

Install OpenSearch Dashboards using Helm

  1. Change to the opensearch-dashboards directory:

    1. cd opensearch-dashboards
  2. Package the Helm chart:

    1. helm package .
  3. Deploy OpenSearch Dashboards:

    1. helm install --generate-name opensearch-dashboards-1.0.0.tgz

    The output shows you the specifications instantiated from the install. To customize the deployment, pass in the values that you want to override with a custom YAML file:

    1. helm install --values=customvalues.yaml opensearch-dashboards-1.0.0.tgz

Sample output

  1. NAME: opensearch-dashboards-1-1629223356
  2. LAST DEPLOYED: Tue Aug 17 18:02:37 2021
  3. NAMESPACE: default
  4. STATUS: deployed
  5. REVISION: 1
  6. TEST SUITE: None
  7. NOTES:
  8. 1. Get the application URL by running these commands:
  9. export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=opensearch-dashboards,app.kubernetes.io/instance=op
  10. ensearch-dashboards-1-1629223356" -o jsonpath="{.items[0].metadata.name}")
  11. export CONTAINER_PORT=$(kubectl get pod --namespace default $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
  12. echo "Visit http://127.0.0.1:8080 to use your application"
  13. kubectl --namespace default port-forward $POD_NAME 8080:$CONTAINER_PORT

To make sure your OpenSearch Dashboards pod is up and running, run the following command:

  1. $ kubectl get pods
  2. NAME READY STATUS RESTARTS AGE
  3. opensearch-cluster-master-0 1/1 Running 0 4m35s
  4. opensearch-cluster-master-1 1/1 Running 0 4m35s
  5. opensearch-cluster-master-2 1/1 Running 0 4m35s
  6. opensearch-dashboards-1-1629223356-758bd8747f-8www5 1/1 Running 0 66s

To set up port forwarding to access OpenSearch Dashboards, exit the OpenSearch shell and run the following command:

  1. $ kubectl port-forward deployment/opensearch-dashboards-1-1629223356 5601

You can now access OpenSearch Dashboards from your browser at: http://localhost:5601.

Uninstall using Helm

To identify the OpenSearch Dashboards deployment that you want to delete:

  1. $ helm list
  2. NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
  3. opensearch-1-1629223146 default 1 2021-08-17 17:59:07.664498239 +0000 UTCdeployedopensearch-1.0.0 1.0.0
  4. opensearch-dashboards-1-1629223356 default 1 2021-08-17 18:02:37.600796946 +0000 UTCdepl
  5. oyedopensearch-dashboards-1.0.0 1.0.0

To delete or uninstall a deployment, run the following command:

  1. helm delete opensearch-dashboards-1-1629223356