-
Notifications
You must be signed in to change notification settings - Fork 1
/
elasticsearch.yaml
132 lines (132 loc) · 3.4 KB
/
elasticsearch.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
kind: Service
apiVersion: v1
metadata:
annotations:
prometheus.io/scrape: 'true'
prometheus.io/port: '9108'
name: elasticsearch
labels:
app: elasticsearch
spec:
type: NodePort
ports:
- port: 9200
nodePort: 30920
protocol: TCP
name: http
- port: 9300
name: node-to-node
protocol: TCP
- port: 9108
name: metrics
protocol: TCP
selector:
app: elasticsearch
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: elasticsearch
spec:
serviceName: elasticsearch
replicas: 1
selector:
matchLabels:
app: elasticsearch
template:
metadata:
labels:
app: elasticsearch
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- elasticsearch
topologyKey: kubernetes.io/hostname
initContainers:
- name: sysctl
image: alpine:3.8
command:
- sh
- -c
- "sysctl -w vm.max_map_count=262144 && chown -R 1000:1000 /usr/share/elasticsearch/data"
volumeMounts:
- name: es-data
mountPath: /usr/share/elasticsearch/data
imagePullPolicy: IfNotPresent
resources:
limits:
cpu: 100m
memory: 200Mi
requests:
cpu: 100m
memory: 200Mi
securityContext:
privileged: true
containers:
- name: exporter
image: justwatch/elasticsearch_exporter:1.0.2
args:
- '-es.uri=http://localhost:9200'
ports:
- containerPort: 9108
name: metrics
resources:
limits:
cpu: 200m
memory: 400Mi
requests:
cpu: 100m
memory: 200Mi
- name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:6.4.1
env:
- name: http.host
value: "0.0.0.0"
- name: ES_JAVA_OPTS
value: -Xms2G -Xmx2G
- name: bootstrap.memory_lock
value: "false"
- name: cluster.name
value: elasticsearch
- name: node.name
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: discovery.zen.ping.unicast.hosts
value: "elasticsearch-0.elasticsearch"
ports:
- containerPort: 9200
name: http
- containerPort: 9300
name: node-to-node
volumeMounts:
- name: es-data
mountPath: /usr/share/elasticsearch/data
readinessProbe:
httpGet:
path: /_cat/health
port: http
initialDelaySeconds: 20
periodSeconds: 5
livenessProbe:
failureThreshold: 5
httpGet:
path: /_cat/health
port: http
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
volumeClaimTemplates:
- metadata:
name: es-data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 500m