Professional Documents
Culture Documents
Installing Elastic Search in k8s Cluster1.28 Using Helm and Deployment Manifest File
Installing Elastic Search in k8s Cluster1.28 Using Helm and Deployment Manifest File
Elastic search:
Uses: Uses:
● Log Aggregation: Elasticsearch can ingest and index large volumes of logs from
various sources, making it suitable for log aggregation and analysis.
● Full-text Search: Elasticsearch provides powerful full-text search capabilities,
enabling users to search and analyze textual data efficiently.
● Monitoring and Analytics: Elasticsearch can be used to store and analyze metrics
and monitoring data from applications and infrastructure components.
● Data Analysis: Elasticsearch supports complex queries, aggregations, and
analytics, making it useful for performing data analysis tasks on large datasets.
Architecture:
Add Helm Repository: If you haven't already added the Elastic Helm repository, you can
do so using the following command:
Install Elasticsearch: Once the repository is added, you can install Elasticsearch
using the Helm chart.
Values.yaml:
# values.yaml
imageTag: "7.16.1"
replicas: 3
esJavaOpts: "-Xmx2g -Xms2g"
To install Elasticsearch using the custom values file.
helm install elasticsearch elastic/elasticsearch -f values.yaml
The other way of deploying the elatci search is deploy using manifest file:
Elastic-search-deployment .yaml
# elasticsearch-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: elasticsearch
spec:
replicas: 1
selector:
matchLabels:
app: elasticsearch
template:
metadata:
labels:
app: elasticsearch
spec:
containers:
- name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:7.0.0
ports:
- containerPort: 9200
name: http
- containerPort: 9300
name: transport
resources:
requests:
env:
- name: discovery.type
elasticsearch-svc.yaml
# elasticsearch-service.yaml
apiVersion: v1
kind: Service
metadata:
name: elasticsearch
spec:
selector:
app: elasticsearch
ports:
- protocol: TCP
port: 9200
targetPort: 9200
name: http
- protocol: TCP
port: 9300
targetPort: 9300
name: transport
type: NodePort
To deploy: