1. Installing the operator #
CRDs and operator.
Installation #
kubectl create -f https://download.elastic.co/downloads/eck/2.16.1/crds.yaml
kubectl apply -f https://download.elastic.co/downloads/eck/2.16.1/operator.yaml
kubectl -n elastic-system logs statefulset/elastic-operatorGood to know: Replace the ECK version with the latest published one; it determines the supported Stack versions.
2. Declaring a cluster #
nodeSets and volumes.
Manifest #
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata: { name: logs }
spec:
version: 8.17.0
nodeSets:
- name: master
count: 3
config: { node.roles: [ master ] }
volumeClaimTemplates:
- metadata: { name: elasticsearch-data }
spec: { accessModes: [ ReadWriteOnce ], resources: { requests: { storage: 10Gi } } }
- name: hot
count: 3
config: { node.roles: [ data_hot, data_content, ingest ] }
podTemplate:
spec:
containers:
- name: elasticsearch
resources: { requests: { memory: 8Gi, cpu: 2 }, limits: { memory: 8Gi } }
volumeClaimTemplates:
- metadata: { name: elasticsearch-data }
spec: { accessModes: [ ReadWriteOnce ], storageClassName: fast-ssd, resources: { requests: { storage: 500Gi } } }
---
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata: { name: logs }
spec: { version: 8.17.0, count: 1, elasticsearchRef: { name: logs } }kubectl get elasticsearch
kubectl get secret logs-es-elastic-user -o go-template='{{.data.elastic | base64decode}}' 3. Operating #
Upgrades and pitfalls.
Practices #
- Upgrade: change
spec.version; ECK restarts pods one by one while respecting cluster health. - Resize a nodeSet: change
count; ECK migrates data before deleting a pod. - TLS and the
elasticuser are generated automatically; custom certificates are possible. - Per-node anti-affinity and spreading across zones (
topologySpreadConstraints) for high availability.
Common mistake: A StorageClass withreclaimPolicy: Deletedestroys data when the cluster is deleted. For production, useRetainand snapshots.
My progress
Sign in to track your progress and take notes. Sign in
💬 Recent discussions about this course
- Elasticsearch : supprimer automatiquement les logs de plus de 30 jours✓ solved · 1 reply(ies)
Ask a question about this lesson →See all discussions about this course
Course Glossary
RBAC (Role-Based Access Control)
An access control method where permissions are assigned to specific roles (e.g., admin, reader) rather than directly to individual users.
Authentication
The process of verifying the identity of a user or system (e.g., login/password, tokens, biometrics).
Authorization
The process that occurs after authentication to determine if the entity has the necessary rights and privileges to access a resource.
API Key
A unique alphanumeric code used to identify, authenticate, and authorize access to an Application Programming Interface (API).
Architecture
The overall structural design of an IT system, defining its various components, their relationships, and the principles guiding its evolution.
Repository
A centralized storage location. This can refer to a source code repository (e.g., Git) or an artifact and binary repository (e.g., Harbor, Nexus, Arti...
Elasticsearch
A distributed, RESTful search and analytics engine capable of addressing a growing number of use cases, built on Apache Lucene.
Recommended Articles
Logstash: enrich, test, monitor and deploy on Kubernetes
Enrich with translate, geoip and elasticsearch, consume Kafka, test pipelines, monitor Logstash a...
Automation and infrastructure as code for Elasticsearch: API, Terraform, Ansible and CI/CD
Automate Elasticsearch administration: REST API and clients, the elasticstack Terraform provider ...
OpenTelemetry traces in Elasticsearch and Kibana APM
Instrument applications with OpenTelemetry or EDOT SDKs, send traces to Elasticsearch, get Kibana...
Transforms and enrich: summarising and enriching data in Elasticsearch
Build entity-centric indices with pivot and latest transforms, and enrich documents at ingest tim...
Logstash in production: persistent queues, DLQ and multiple pipelines
Make Logstash reliable in production: persistent queue, dead letter queue, multiple pipelines and...
Elastic Agent on Kubernetes
Deploy Elastic Agent on Kubernetes: Fleet-managed DaemonSet, Kubernetes integration, kube-state-m...
Grafana Loki vs Elasticsearch: the battle of log storage
A comparison between Loki, the Prometheus-inspired log system, and Elasticsearch, the reference f...
OpenTelemetry metrics in Elasticsearch
Collect host, Kubernetes and application metrics with OpenTelemetry, understand temporality and t...
OpenTelemetry and Elasticsearch: compatibility and architecture
Send OpenTelemetry to Elasticsearch: Collector and elasticsearch exporter, managed OTLP endpoint,...