-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelasticsearch-single.yml
95 lines (91 loc) · 1.89 KB
/
elasticsearch-single.yml
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
# 单节点es
---
# PVC
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: elasticsearch
namespace: n9e
spec:
storageClassName: local-path
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
---
# StatefulSet
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: elasticsearch
namespace: n9e
spec:
serviceName: elasticsearch
replicas: 1
selector:
matchLabels:
app: elasticsearch
template:
metadata:
labels:
app: elasticsearch
spec:
# nodeSelector:
# eks.amazonaws.com/nodegroup: node-8c-32G
initContainers:
- name: increase-vm-max-map
image: busybox
command: ["sysctl", "-w", "vm.max_map_count=262144"]
securityContext:
privileged: true
- name: increase-fd-ulimit
image: busybox
command: ["sh", "-c", "ulimit -n 65536"]
securityContext:
privileged: true
containers:
- name: elasticsearch
image: elasticsearch:7.17.9
ports:
- name: rest
containerPort: 9200
resources:
limits:
cpu: 1000m
memory: 2G
requests:
cpu: 1000m
memory: 1G
volumeMounts:
- name: data
mountPath: /usr/share/elasticsearch/data
env:
- name: node.name
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: discovery.type
value: single-node
- name: ES_JAVA_OPTS
value: "-Xms1024m -Xmx1024m"
- name: network.host
value: "0.0.0.0"
volumes:
- name: data
persistentVolumeClaim:
claimName: elasticsearch
---
# Service
kind: Service
apiVersion: v1
metadata:
name: elasticsearch
namespace: n9e
spec:
selector:
app: elasticsearch
clusterIP: None
ports:
- port: 9200
name: rest