> For the complete documentation index, see [llms.txt](https://docs.opstreelabs.in/logging-operator/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opstreelabs.in/logging-operator/setups.md).

# Setup

A guide to setup elasticsearch on Kubernetes cluster using "Logging Operator".

Elasticsearch, Fluentd, and Kibana setup can be done by `kubectl` and `helm`. The API for information for elasticsearch is:-

## Elasticsearch

Elasticsearch API information:-

```yaml
---
apiVersion: logging.opstreelabs.in/v1alpha1
kind: Elasticsearch
```

### Kubectl <a href="#kubectl" id="kubectl"></a>

For deployment using kubectl, we can use [config/samples/elasticsearch.yaml](https://github.com/OT-CONTAINER-KIT/logging-operator/blob/master/config/samples/elasticsearch-example.yaml) file.

```
kubectl apply -f config/samples/elasticsearch-example.yaml
```

Elasticsearch configurated can be updated in the same file.

### Helm <a href="#helm" id="helm"></a>

Helm can also be used to setup elasticsearch. Get into the directory [helm-charts/logging-setup](https://github.com/OT-CONTAINER-KIT/logging-operator/tree/master/helm-charts/logging-setup).

```bash
helm upgrade elastic-stack ./ -f values.yaml \
    --set elasticsearch.enabled=true \
    --set elasticsearch.master.enabled=true \
    --set elasticsearch.master.replicas=3 \
    --set elasticsearch.data.enabled=true \
    --set elasticsearch.data.replicas=3 \
    --set elasticsearch.client.enabled=true \
    --set elasticsearch.client.replicas=1 \
    --set elasticsearch.ingestion.enabled=true \
    --set elasticsearch.ingestion.replicas=1 \
    --namespace logging-operator --install
```

Validate the elasticsearch cluster.

![](https://gblobscdn.gitbook.com/assets%2F-MFUXjPDy3L9uzAytN5b%2F-MFeNiHycE4T-uQoJMjW%2F-MFeO8jps1S7KesWYmku%2Felastic.png?alt=media\&token=b2c4ed1c-d550-4665-9e6f-b74fcd015360)

## Fluentd

Fluentd API information:-

```yaml
---
apiVersion: logging.opstreelabs.in/v1alpha1
kind: Fluentd
```

### Kubectl

For deployment using kubectl, we can use [config/samples/fluentd.yaml](https://github.com/OT-CONTAINER-KIT/logging-operator/blob/master/config/samples/fluentd-example.yaml) file.

```bash
kubectl apply -f config/samples/fluentd-example.yaml
```

Fluentd configurated can be updated in the same file.

### Helm <a href="#helm" id="helm"></a>

Helm can also be used to setup fluentd. Get into the directory [helm-charts/logging-setup](https://github.com/OT-CONTAINER-KIT/logging-operator/tree/master/helm-charts/logging-setup).

```bash
helm upgrade fluentd-stack ./ \
    -f values.yaml --set fluentd.enabled=true \
    --namesapce logging-operator --install
```

Validate fluentd status

![](https://gblobscdn.gitbook.com/assets%2F-MFUXjPDy3L9uzAytN5b%2F-MFeOLynvjPylWGT3jTU%2F-MFeSYGWxgViMka84Hq_%2Ffluentd.png?alt=media\&token=04f6ed2d-efb8-4d45-8800-b2a1016a6b2f)

## Kibana

Kibana API information:-

```yaml
---
apiVersion: logging.opstreelabs.in/v1alpha1
kind: Kibana
```

### Kubectl

For deployment using kubectl, we can use [config/samples/kibana.yaml](https://github.com/OT-CONTAINER-KIT/logging-operator/blob/master/config/samples/kibana-example.yaml) file.

```bash
kubectl apply -f config/samples/kibana-example.yaml
```

Kibana configuration can be updated in the same file.

### Helm <a href="#helm" id="helm"></a>

Helm can also be used to setup kibana. Get into the directory [helm-charts/logging-setup](https://github.com/OT-CONTAINER-KIT/logging-operator/tree/master/helm-charts/logging-setup).

```bash
helm upgrade kibana-stack ./ \
    -f values.yaml --set kibana.enabled=true \
    --namespace logging-operator --install
```

![](https://gblobscdn.gitbook.com/assets%2F-MFUXjPDy3L9uzAytN5b%2F-MFeSbzGb1voQZUOACN9%2F-MFeTUO42Z8a4eXfsmZB%2Fkibana.png?alt=media\&token=0a93587f-7765-4cb4-b359-cc1d0f2cae74)
