forked from C2-Labs/k8s-security-elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
es-client.yaml
111 lines (110 loc) · 2.64 KB
/
es-client.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
---
apiVersion: v1
kind: ConfigMap
metadata:
namespace: es
name: es-client-config
labels:
app: elasticsearch
role: client
data:
elasticsearch.yml: |-
cluster.name: ${CLUSTER_NAME}
node.name: ${NODE_NAME}
discovery.seed_hosts: ${NODE_LIST}
cluster.initial_master_nodes: ${MASTER_NODES}
network.host: 0.0.0.0
node:
master: false
data: false
ingest: true
xpack.security.enabled: true
xpack.monitoring.collection.enabled: true
# xpack.security.http.ssl.enabled: true
# xpack.security.http.ssl.key: /usr/share/elasticsearch/config/certs/tls.key
# xpack.security.http.ssl.certificate: /usr/share/elasticsearch/config/certs/tls.crt
# xpack.security.http.ssl.certificate_authorities: /usr/share/elasticsearch/config/certs/ca.crt
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: es
name: es-client
labels:
app: elasticsearch
role: client
spec:
replicas: 1
selector:
matchLabels:
app: elasticsearch
role: client
template:
metadata:
labels:
app: elasticsearch
role: client
spec:
containers:
- name: es-client
image: docker.elastic.co/elasticsearch/elasticsearch:7.6.1
env:
- name: CLUSTER_NAME
value: elasticsearch
- name: NODE_NAME
value: es-client
- name: NODE_LIST
value: es-master,es-data,es-client
- name: MASTER_NODES
value: es-master
- name: "ES_JAVA_OPTS"
value: "-Xms256m -Xmx256m"
ports:
- containerPort: 9200
name: client
- containerPort: 9300
name: transport
volumeMounts:
- name: config
mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
readOnly: true
subPath: elasticsearch.yml
- name: storage
mountPath: /data
- name: es-http-tls
mountPath: /usr/share/elasticsearch/config/certs
readOnly: true
volumes:
- name: config
configMap:
name: es-client-config
- name: "storage"
emptyDir:
medium: ""
- name: es-http-tls
secret:
secretName: es-http-tls
initContainers:
- name: increase-vm-max-map
image: busybox
command: ["sysctl", "-w", "vm.max_map_count=262144"]
securityContext:
privileged: true
---
apiVersion: v1
kind: Service
metadata:
namespace: es
name: es-client
labels:
app: elasticsearch
role: client
spec:
ports:
- port: 9200
name: client
- port: 9300
name: transport
selector:
app: elasticsearch
role: client