-
Notifications
You must be signed in to change notification settings - Fork 9
/
es-deploy.yaml
58 lines (58 loc) · 1.26 KB
/
es-deploy.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
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: es-deploy
labels:
service: es-deploy
spec:
replicas: 2
template:
metadata:
labels:
service: es-deploy
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: service
operator: In
values:
- es-deploy
topologyKey: "kubernetes.io/hostname"
initContainers:
- name: init-sysctl
image: busybox:1.30
command: ["sysctl", "-w", "vm.max_map_count=262144"]
securityContext:
privileged: true
containers:
- name: es
image: docker.elastic.co/elasticsearch/elasticsearch:6.7.2
readinessProbe:
tcpSocket:
port: 9200
initialDelaySeconds: 20
periodSeconds: 30
ports:
- containerPort: 9200
- containerPort: 9300
---
apiVersion: v1
kind: Service
metadata:
name: es6
spec:
type: NodePort
selector:
service: es-deploy
ports:
- name: "9200"
port: 9200
targetPort: 9200
nodePort: 30001
- name: "9300"
port: 9300
targetPort: 9300
nodePort: 30002