Helm

Helm is a package manager that allows you to easily install and manage OpenSearch 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

The default Helm chart deploys a three-node cluster. We recommend that you have at least 8 GiB of memory available for this deployment. You can expect the deployment to fail if, say, you have less than 4 GiB of memory available.

Install OpenSearch using Helm

  1. Add opensearch helm-charts repository to Helm:

    1. helm repo add opensearch https://opensearch-project.github.io/helm-charts/

    copy

  2. Update the available charts locally from charts repositories:

    1. helm repo update

    copy

  3. To search for the OpenSearch-related Helm charts:

    1. helm search repo opensearch

    copy

    1. NAME CHART VERSION APP VERSION DESCRIPTION
    2. opensearch/opensearch 1.0.7 1.0.0 A Helm chart for OpenSearch
    3. opensearch/opensearch-dashboards 1.0.4 1.0.0 A Helm chart for OpenSearch Dashboards
  4. Deploy OpenSearch:

    1. helm install my-deployment opensearch/opensearch

    copy

You can also build the opensearch-1.0.0.tgz file manually:

  1. Change to the opensearch directory:

    1. cd charts/opensearch

    copy

  2. Package the Helm chart:

    1. helm package .

    copy

  3. Deploy OpenSearch:

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

    copy

    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-1.0.0.tgz

    copy

Sample output

  1. NAME: opensearch-1-1629223146
  2. LAST DEPLOYED: Tue Aug 17 17:59:07 2021
  3. NAMESPACE: default
  4. STATUS: deployed
  5. REVISION: 1
  6. TEST SUITE: None
  7. NOTES:
  8. Watch all cluster members come up.
  9. $ kubectl get pods --namespace=default -l app=opensearch-cluster-master -w

To make sure your OpenSearch 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 3m56s
  4. opensearch-cluster-master-1 1/1 Running 0 3m56s
  5. opensearch-cluster-master-2 1/1 Running 0 3m56s

To access the OpenSearch shell:

  1. $ kubectl exec -it opensearch-cluster-master-0 -- /bin/bash

copy

You can send requests to the pod to verify that OpenSearch is up and running:

  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" : <version>,
  9. "build_type" : <build-type>,
  10. "build_hash" : <build-hash>,
  11. "build_date" : <build-date>,
  12. "build_snapshot" : false,
  13. "lucene_version" : <lucene-version>,
  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. }

Uninstall using Helm

To identify the OpenSearch deployment that you want to delete:

  1. $ helm list
  2. NAME NAMESPACEREVISIONUPDATED 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

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

  1. helm delete opensearch-1-1629223146

copy

For steps to install OpenSearch Dashboards, see Helm to install OpenSearch Dashboards.