Stack Monitoring

edit

You can enable Stack Monitoring on Elasticsearch and Kibana to collect and ship their metrics and logs to a dedicated monitoring cluster.

To enable stack monitoring, simply reference the monitoring Elasticsearch cluster in the spec.monitoring section of their specification.

apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: monitored-sample
  namespace: production
spec:
  version: 8.15.3
  monitoring:
    metrics:
      elasticsearchRefs:
      - name: monitoring
        namespace: observability 
    logs:
      elasticsearchRefs:
      - name: monitoring
        namespace: observability 
  nodeSets:
  - name: default
    count: 1
    config:
      node.store.allow_mmap: false
---
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: monitored-sample
  namespace: production
spec:
  version: 8.15.3
  elasticsearchRef:
    name: monitored-sample
    namespace: production 
  monitoring:
    metrics:
      elasticsearchRefs:
      - name: monitoring
        namespace: observability 
    logs:
      elasticsearchRefs:
      - name: monitoring
        namespace: observability 
  count: 1

The use of namespace is optional if the monitoring Elasticsearch cluster and the monitored Elasticsearch cluster are running in the same namespace.

The use of namespace is optional if the Elasticsearch cluster and the Kibana instance are running in the same namespace.

You cannot configure an Elasticsearch cluster to monitor itself, the monitoring cluster has to be a separate cluster.

The monitoring cluster must be managed by ECK in the same Kubernetes cluster as the monitored one.

You can send metrics and logs to two different Elasticsearch monitoring clusters.

You can also enable Stack Monitoring on Elasticsearch only or on Kibana only. In the latter case, Kibana will not be available on the Stack Monitoring Kibana page (see View monitoring data in Kibana).