This repository has been archived by the owner on Apr 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathelasticsearch-sts.yaml
85 lines (84 loc) · 2.45 KB
/
elasticsearch-sts.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#######################################################################
# Kubernetes StatefulSet for the Elasticsearch single node setup
#
# This is a simple Elasticsearch deployment. You should follow best
# practices if ever you want to go in production with this setup.
#
# The https://github.com/pires/kubernetes-elasticsearch-cluster
# repository is a nice example!
#######################################################################
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: wazuh-elasticsearch
namespace: wazuh
spec:
replicas: 1
selector:
matchLabels:
app: wazuh-elasticsearch
serviceName: wazuh-elasticsearch
template:
metadata:
labels:
app: wazuh-elasticsearch
name: wazuh-elasticsearch
spec:
# Set the wazuh-elasticsearch volume permissions so the elasticsearch user can use it!
initContainers:
- name: volume-mount-hack
image: busybox
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
cpu: 100m
memory: 256Mi
command:
- sh
- '-c'
- 'chown -R 1000:1000 /usr/share/elasticsearch/data'
volumeMounts:
- name: wazuh-elasticsearch
mountPath: /usr/share/elasticsearch/data
containers:
- name: wazuh-elasticsearch
image: 'docker.elastic.co/elasticsearch/elasticsearch:6.4.0'
resources:
requests:
cpu: 500m
memory: 1Gi
limits:
cpu: 1
memory: 2Gi
env:
- name: ES_JAVA_OPTS
value: '-Xms1024m -Xmx1024m'
- name: bootstrap.memory_lock
value: 'false'
- name: cluster.name
value: wazuh
- name: network.host
value: 0.0.0.0
- name: node.name
value: node-1
volumeMounts:
- name: wazuh-elasticsearch
mountPath: /usr/share/elasticsearch/data
ports:
- containerPort: 9200
name: es-rest
- containerPort: 9300
name: es-nodes
volumeClaimTemplates:
- metadata:
name: wazuh-elasticsearch
namespace: wazuh
spec:
accessModes:
- ReadWriteOnce
storageClassName: gp2-encrypted-retained
resources:
requests:
storage: 30Gi