-
Notifications
You must be signed in to change notification settings - Fork 1
/
0.es-single.yaml
112 lines (107 loc) · 2.78 KB
/
0.es-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
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
apiVersion: v1
kind: Namespace
metadata:
name: kube-elk
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
namespace: kube-elk
name: elastic-cluster
labels:
component: elasticsearch
spec:
serviceName: elasticsearch
replicas: 1 #Required number of replicas
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
component: elasticsearch
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
# Specific Host will be ES-Nodes.
- host-10-1-2-71
securityContext:
fsGroup: 1000
initContainers: #will always initialize before other containers
- name: init-sysctl
image: busybox
imagePullPolicy: IfNotPresent
command: ["sysctl", "-w", "vm.max_map_count=262144"]
securityContext:
privileged: true
containers:
- name: elasticsearch
#resources:
# requests:
# memory: 1Gi
securityContext:
privileged: true
runAsUser: 1000
capabilities:
add:
- IPC_LOCK
- SYS_RESOURCE
env:
#- name: discovery.type
# value: single-node
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: discovery.type
value: single-node
- name: ES_JAVA_OPTS
value: "-Xms4g -Xmx4g"
#"-Xms512m -Xmx512m"
image: docker.elastic.co/elasticsearch/elasticsearch:6.6.0
# Image Tag Version => https://www.docker.elastic.co/
#imagePullPolicy: Always
readinessProbe:
httpGet:
scheme: HTTP
path: /_cluster/health?local=true
port: 9200
initialDelaySeconds: 5
volumeMounts:
- name: vl-es-data
mountPath: "/usr/share/elasticsearch/data"
ports:
- containerPort: 9200
name: http
protocol: TCP
volumes:
- name: vl-es-data
hostPath:
# ES data will store at Local DISK! - You have to Create and set permission!! (chown 1000...)
path: "/opt/elastic"
type: DirectoryOrCreate
---
# For Serving
apiVersion: v1
kind: Service
metadata:
name: elasticsearch-client
namespace: kube-elk
#labels:
# component: elasticsearch
spec:
type: LoadBalancer
selector:
component: elasticsearch
ports:
- name: http
port: 9200
protocol: TCP
---
# You can check cluster health with this URL
# > http://elasticsearch-client.kube-elk:9200/_cluster/health?pretty