|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +title: Helm |
| 4 | +parent: Install and Configure |
| 5 | +nav_order: 5 |
| 6 | +--- |
| 7 | + |
| 8 | +# Helm |
| 9 | + |
| 10 | +Helm is a package manager that allows you easily install and manage Elasticsearch in a Kubernetes cluster. You can define your Elasticsearch configurations in a YAML file and use Helm to deploy your applications in a version-controlled and reproducible way. |
| 11 | + |
| 12 | +The Helm chart contains the following resources: |
| 13 | + |
| 14 | +Resource | Description |
| 15 | +:--- | :--- |
| 16 | +`Chart.yaml` | Information about the chart. |
| 17 | +`values.yaml` | Default configuration values for the chart. |
| 18 | +`templates` | Templates that combine with values to generate the Kubernetes manifest files. |
| 19 | + |
| 20 | +The specification in the default Helm chart caters to a number of 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). |
| 21 | + |
| 22 | +For information about the default configuration, steps to configure security, and configurable parameters, see the |
| 23 | +[README](https://github.com/opendistro-for-elasticsearch/community/tree/master/open-distro-elasticsearch-kubernetes/helm). |
| 24 | + |
| 25 | +The instructions here assume you have a Kubernetes cluster with Helm preinstalled. See the [Kubernetes documentation](https://kubernetes.io/docs/setup/) for steps to configure a Kubernetes cluster and the [Helm documentation](https://helm.sh/docs/intro/install/) to install Helm. |
| 26 | +Run the `helm init` command to make sure you also have the Tiller server installed. For more information about Tiller, see the [Tiller documentation](https://tiller.readthedocs.io/en/latest/). |
| 27 | +{: .note } |
| 28 | + |
| 29 | +## Install using Helm |
| 30 | + |
| 31 | +1. Clone the [opendistro-build](https://github.com/opendistro-for-elasticsearch/opendistro-build) repository: |
| 32 | + |
| 33 | + ```bash |
| 34 | + git clone https://github.com/opendistro-for-elasticsearch/opendistro-build |
| 35 | + ``` |
| 36 | + |
| 37 | +1. Change to the `opendistro-es` directory: |
| 38 | + |
| 39 | + ```bash |
| 40 | + cd helm/opendistro-es/ |
| 41 | + ``` |
| 42 | + |
| 43 | +1. Package the Helm chart: |
| 44 | + |
| 45 | + ```bash |
| 46 | + helm package . |
| 47 | + ``` |
| 48 | + |
| 49 | +1. Deploy Elasticsearch: |
| 50 | + |
| 51 | + ```bash |
| 52 | + helm install --name opendistro-es opendistro-es-1.1.0.tgz |
| 53 | + ``` |
| 54 | + |
| 55 | +If you see a `namespaces "default" is forbidden` error, create a tiller service account and deploy with a cluster binding role. |
| 56 | +See the [Tiller documentation](https://tiller.readthedocs.io/en/latest/) for more information. |
| 57 | +For example: |
| 58 | + |
| 59 | +```bash |
| 60 | +$ kubectl create serviceaccount --namespace kube-system tiller |
| 61 | +$ kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller |
| 62 | +$ kubectl patch deploy --namespace kube-system tiller-deploy -p'{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}' |
| 63 | +``` |
| 64 | + |
| 65 | +The output shows you the specifications instantiated from the install. |
| 66 | +To customize the deployment, pass in the values that you want to override with a custom YAML file: |
| 67 | + |
| 68 | +```bash |
| 69 | +helm install --values=customevalues.yaml opendistro-es-1.1.0.tgz |
| 70 | +``` |
| 71 | + |
| 72 | +#### Sample output |
| 73 | + |
| 74 | +```yaml |
| 75 | +NAME: opendistro-es |
| 76 | +LAST DEPLOYED: Tue Dec 17 14:33:48 2019 |
| 77 | +NAMESPACE: default |
| 78 | +STATUS: DEPLOYED |
| 79 | + |
| 80 | +RESOURCES: |
| 81 | +==> v1/Pod(related) |
| 82 | +NAME AGE |
| 83 | +opendistro-es-client-77b988f547-ddbvc 1s |
| 84 | +opendistro-es-client-77b988f547-gtgtx 1s |
| 85 | +opendistro-es-data-0 1s |
| 86 | +opendistro-es-kibana-f785fdb84-8czxb 1s |
| 87 | +opendistro-es-master-0 1s |
| 88 | + |
| 89 | +==> v1/RoleBinding |
| 90 | +NAME AGE |
| 91 | +opendistro-es-elastic-rolebinding 1s |
| 92 | +opendistro-es-kibana-rolebinding 1s |
| 93 | + |
| 94 | +==> v1/Secret |
| 95 | +NAME AGE |
| 96 | +opendistro-es-es-config 1s |
| 97 | + |
| 98 | +==> v1/Service |
| 99 | +NAME AGE |
| 100 | +opendistro-es-client-service 1s |
| 101 | +opendistro-es-data-svc 1s |
| 102 | +opendistro-es-discovery 1s |
| 103 | +opendistro-es-kibana-svc 1s |
| 104 | + |
| 105 | +==> v1/ServiceAccount |
| 106 | +NAME AGE |
| 107 | +opendistro-es-es 1s |
| 108 | +opendistro-es-kibana 1s |
| 109 | + |
| 110 | +==> v1beta1/Deployment |
| 111 | +NAME AGE |
| 112 | +opendistro-es-client 1s |
| 113 | +opendistro-es-kibana 1s |
| 114 | + |
| 115 | +==> v1beta1/Ingress |
| 116 | +NAME AGE |
| 117 | +opendistro-es-client-service 1s |
| 118 | + |
| 119 | +==> v1beta1/PodSecurityPolicy |
| 120 | +NAME AGE |
| 121 | +opendistro-es-psp 1s |
| 122 | + |
| 123 | +==> v1beta1/Role |
| 124 | +NAME AGE |
| 125 | +opendistro-es-es 1s |
| 126 | +opendistro-es-kibana 1s |
| 127 | + |
| 128 | +==> v1beta1/StatefulSet |
| 129 | +NAME AGE |
| 130 | +opendistro-es-data 1s |
| 131 | +opendistro-es-master 1s |
| 132 | +``` |
| 133 | + |
| 134 | +To make sure your Elasticsearch cluster is up and running: |
| 135 | + |
| 136 | +```bash |
| 137 | +$ kubectl get pods |
| 138 | + |
| 139 | +NAME READY STATUS RESTARTS AGE |
| 140 | +opendistro-es-13-client-5f87767448-6b6h6 1/1 Running 0 15m |
| 141 | +opendistro-es-13-client-5f87767448-9rvrr 1/1 Running 0 15m |
| 142 | +opendistro-es-data-0 1/1 Running 0 15m |
| 143 | +opendistro-es-kibana-54d4b996c6-g2rxb 1/1 Running 0 15m |
| 144 | +opendistro-es-master-0 1/1 Running 0 15m |
| 145 | +``` |
| 146 | + |
| 147 | +## Uninstall using Helm |
| 148 | + |
| 149 | +To delete or uninstall this deployment: |
| 150 | + |
| 151 | +```bash |
| 152 | +helm delete --name opendistro-es |
| 153 | +``` |
0 commit comments