Skip to content

Commit

Permalink
chore(docs): Add workload page for Elasticsearch
Browse files Browse the repository at this point in the history
Signed-off-by: Naresh Deshaveni <[email protected]>
  • Loading branch information
Naresh Deshaveni committed Jun 1, 2021
1 parent 6dec2be commit 86ec126
Showing 1 changed file with 10 additions and 116 deletions.
126 changes: 10 additions & 116 deletions docs/workload/elasticsearch/elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,23 @@ Advantages of using OpenEBS for Elasticsearch database:
<br>

## Configuration workflow
1. [Install OpenEBS](/docs/workload/prometheus-operator/prometheus.md#prerequisites)

<br>
2. [Installing Elasticsearch ](/docs/workload/prometheus-operator/prometheus.md#installing-elasticsearch)

1. **Install OpenEBS**

If OpenEBS is not installed in your K8s cluster, this can done from [here](https://docs.openebs.io/docs/next/installation.html). If OpenEBS is already installed, go to the next step.
<br>

2. **Configure cStor Pool**

After OpenEBS installation, cStor pool has to be configured. If cStor Pool is not configured in your OpenEBS cluster, this can be done from [here](https://docs.openebs.io/docs/next/ugcstor.html#creating-cStor-storage-pools). During cStor Pool creation, make sure that the maxPools parameter is set to >=3. Sample YAML named **openebs-config.yaml** for configuring cStor Pool is provided in the Configuration details below. If cStor pool is already configured, go to the next step.
### Install OpenEBS

4. **Create Storage Class**
If OpenEBS is not installed in your K8s cluster, this can done from [here](https://docs.openebs.io/docs/next/installation.html). If OpenEBS is already installed, go to the next step.

You must configure a StorageClass to provision cStor volume on given cStor pool. StorageClass is the interface through which most of the OpenEBS storage policies are defined. In this solution we are using a StorageClass to consume the cStor Pool which is created using external disks attached on the Nodes. Since Elasticsearch is a StatefulSet, it requires only single storage replica. So cStor volume `replicaCount` is >=1. Sample YAML named **openebs-sc-disk.yaml**to consume cStor pool with cStor volume replica count as 1 is provided in the configuration details below.
- Choose **cStor**, If you are looking for replicated storage feature and other enterprise graded features such as volume expansion, backup and restore, etc. cStor configuration can be found [here](https://github.com/openebs/cstor-operators/blob/master/docs/quick.md). In this document, we will be doing Elasticsearch installation using OpenEBS cStor.
- Choose **OpenEBS Local PV**, if you are not requiring replicated storage but high performance storage engine. The steps for deploying Prometheus operator using OpenEBS Local PV can be found [here](https://docs.openebs.io/docs/next/elasticsearch.html).

5. **Launch and test Elasticsearch**

### Installing Elasticsearch

Use latest Elasticsearch chart with helm to deploy Elasticsearch in your cluster using the following command. In the following command, it will create PVC with 30G size.

Expand All @@ -72,123 +73,16 @@ Advantages of using OpenEBS for Elasticsearch database:

<br>

<hr>

<br>

## Reference at [openebs.ci](https://openebs.ci/)

<br>



A live deployment of Elasticsearch with Kibana using OpenEBS volumes can be seen at the website [www.openebs.ci](https://openebs.ci/)

Deployment YAML spec files for Elasticsearch and OpenEBS resources are found [here](https://github.com/openebs/e2e-infrastructure/blob/54fe55c5da8b46503e207fe0bc08f9624b31e24c/production/efk-server/Elasticsearch/es-statefulset.yaml)

[OpenEBS-CI dashboard of Elasticsearch](https://openebs.ci/logging)

[Live access to Elasticsearch dashboard](https://e2elogs.openebs.ci/app/kibana)



<br>

<hr>

<br>



## Post deployment Operations

<br>

**Monitor OpenEBS Volume size**

It is not seamless to increase the cStor volume size (refer to the roadmap item). Hence, it is recommended that sufficient size is allocated during the initial configuration.

**Monitor cStor Pool size**

As in most cases, cStor pool may not be dedicated to just Elasticsearch database alone. It is recommended to watch the pool capacity and add more disks to the pool before it hits 80% threshold. See [cStorPool metrics](https://docs.openebs.io/docs/next/ugcstor.html#monitor-pool).



<br>

<hr>

<br>





## Configuration details

<br>



**openebs-config.yaml**

```yaml
#Use the following YAMLs to create a cStor Storage Pool.
# and associated storage class.
apiVersion: openebs.io/v1alpha1
kind: StoragePoolClaim
metadata:
name: cstor-disk
spec:
name: cstor-disk
type: disk
poolSpec:
poolType: striped
# NOTE - Appropriate disks need to be fetched using `kubectl get blockdevices -n openebs`
#
# `Block devices` is a custom resource supported by OpenEBS with `node-disk-manager`
# as the disk operator
# Replace the following with actual disk CRs from your cluster `kubectl get blockdevices -n openebs`
# Uncomment the below lines after updating the actual disk names.
blockDevices:
blockDeviceList:
# Replace the following with actual disk CRs from your cluster from `kubectl get blockdevices -n openebs`
# - blockdevice-69cdfd958dcce3025ed1ff02b936d9b4
# - blockdevice-891ad1b581591ae6b54a36b5526550a2
# - blockdevice-ceaab442d802ca6aae20c36d20859a0b
---
```

**openebs-sc-disk.yaml**

```
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: openebs-cstor-disk
annotations:
openebs.io/cas-type: cstor
cas.openebs.io/config: |
- name: StoragePoolClaim
value: "cstor-disk"
- name: ReplicaCount
value: "1"
provisioner: openebs.io/provisioner-iscsi
reclaimPolicy: Delete
---
```

<br>


## See Also:

<hr>
<br>
### [cStor User guide](https://github.com/openebs/cstor-operators/blob/master/docs/quick.md)

### [Troubleshooting cStor](https://github.com/openebs/cstor-operators/blob/master/docs/troubleshooting/troubleshooting.md)

<br>

<hr>

0 comments on commit 86ec126

Please sign in to comment.