-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelasticsearch-single.yaml
75 lines (75 loc) · 1.73 KB
/
elasticsearch-single.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
---
apiVersion: v1
kind: Service
metadata:
name: elasticsearch-single
spec:
type: NodePort
selector:
app: elasticsearch-single
ports:
- name: http
port: 9200
nodePort: 31290
protocol: TCP
- name: tcp
port: 9300
protocol: TCP
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: elasticsearch-single
spec:
replicas: 1
template:
metadata:
labels:
app: elasticsearch-single
elasticsearch: master
elasticsearch: client
annotations:
pod.beta.kubernetes.io/init-containers: '[
{
"name": "init",
"image": "busybox:latest",
"command": [ "sh", "-c", "chown 1005:1005 /opt/elasticsearch/data" ],
"volumeMounts": [
{ "name": "data", "mountPath": "/opt/elasticsearch/data" }
],
"imagePullPolicy": "IfNotPresent"
}
]'
spec:
containers:
- name: elasticsearch
securityContext:
privileged: true
capabilities:
add:
- IPC_LOCK
- SYS_RESOURCE
imagePullPolicy: Always
image: henryrao/elasticsearch:2.3.3
ports:
- containerPort: 9200
- containerPort: 9300
env:
- name: ES_HEAP_SIZE
value: 256m
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
args:
- "run.sh"
- "elasticsearch"
- "-Dcluster.name=myesdb"
- "-Dhttp.cors.enabled=true"
- "-Dhttp.cors.allow-origin=*"
volumeMounts:
- name: data
mountPath: /opt/elasticsearch/data
volumes:
- name: data
emptyDir: {}