-
Notifications
You must be signed in to change notification settings - Fork 164
/
Copy pathes.yml
86 lines (84 loc) · 3.39 KB
/
es.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
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: quickstart
spec:
version: 8.11.3
nodeSets:
- name: default
count: 2
podTemplate:
spec:
securityContext:
runAsUser: 1000
containers:
- name: elasticsearch
env:
- name: INTERNAL_USR_PASS
valueFrom:
secretKeyRef:
name: quickstart-es-internal-users
key: elastic-internal
- name: INTERNAL_PROBE_PASS
valueFrom:
secretKeyRef:
name: quickstart-es-internal-users
key: elastic-internal-probe
- name: KIBANA_SERVICE_ACCOUNT_TOKEN
valueFrom:
secretKeyRef:
name: quickstart-kibana-user
key: token
- name: ES_JAVA_OPTS
value: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8888
volumeMounts:
- name: elasticsearch-modules
mountPath: /usr/share/elasticsearch/modules
- name: elasticsearch-lib
mountPath: /usr/share/elasticsearch/lib
- name: config-ror
mountPath: /usr/share/elasticsearch/config/readonlyrest.yml
subPath: readonlyrest.yml
- name: config-log4j2
mountPath: /usr/share/elasticsearch/config/log4j2.properties
subPath: log4j2.properties
initContainers:
- name: sysctl
securityContext:
runAsUser: 0
privileged: true
command: [ 'sh', '-c', 'sysctl -w vm.max_map_count=262144' ]
- name: install-ror-es-plugin
securityContext:
allowPrivilegeEscalation: false
runAsUser: 0
command:
- "/bin/bash"
- "-c"
- |
set -e
/usr/share/elasticsearch/bin/elasticsearch-plugin install --batch "https://api.beshu.tech/download/es?edition=es&esVersion=$ES_VERSION&email=eck-example%40readonlyrest.com"
/usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch
cp -r /usr/share/elasticsearch/modules /target/usr/share/elasticsearch
cp -r /usr/share/elasticsearch/lib /target/usr/share/elasticsearch
env:
- name: ES_VERSION
valueFrom:
fieldRef:
fieldPath: metadata.labels['elasticsearch.k8s.elastic.co/version']
volumeMounts:
- name: elasticsearch-modules
mountPath: /target/usr/share/elasticsearch/modules
- name: elasticsearch-lib
mountPath: /target/usr/share/elasticsearch/lib
volumes:
- name: elasticsearch-modules
emptyDir: { }
- name: elasticsearch-lib
emptyDir: { }
- name: config-ror
configMap:
name: config-readonlyrest.yml
- name: config-log4j2
configMap:
name: config-log4j2.properties.yml