-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathall-in-one.yaml
More file actions
302 lines (296 loc) · 7.27 KB
/
all-in-one.yaml
File metadata and controls
302 lines (296 loc) · 7.27 KB
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
#Trial license , stored in the ECK namespace
apiVersion: v1
kind: Secret
metadata:
name: eck-trial-license
namespace: elastic-system
labels:
license.k8s.elastic.co/type: enterprise_trial
annotations:
elastic.co/eula: accepted
---
#A namespace for all the elastic components
apiVersion: v1
kind: Namespace
metadata:
name: devoops
---
#Elasticsearch password (elastic:elastic)
apiVersion: v1
data:
elastic: ZWxhc3RpYw==
kind: Secret
metadata:
name: esdev-es-elastic-user
namespace: devoops
type: Opaque
---
#Elastic search
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: esdev
namespace: devoops
spec:
version: 8.15.3
nodeSets:
- name: default
count: 1
podTemplate:
spec:
containers:
- name: elasticsearch
env:
- name: ES_JAVA_OPTS
value: -Xms1g -Xmx1g
resources:
requests:
memory: 2Gi
cpu: 1
limits:
memory: 2Gi
config:
# most Elasticsearch configuration parameters are possible to set, e.g: node.attr.attr_name: attr_value
node.roles: ["master", "data", "ingest", "ml"]
# this allows ES to run on nodes even if their vm.max_map_count has not been increased, at a performance cost
node.store.allow_mmap: false
---
#Kibana with SSL disabled
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
name: kbdev
namespace: devoops
spec:
version: 8.15.3
count: 1
config:
server.rewriteBasePath: true
server.basePath: "/kibana"
server.publicBaseUrl: "http://kubernetes.docker.internal/kibana"
xpack.fleet.packages:
- name: apm
version: latest
http:
tls:
selfSignedCertificate:
disabled: true
podTemplate:
spec:
containers:
- name: kibana
readinessProbe:
httpGet:
scheme: HTTP
path: /kibana
port: 5601
env:
- name: NODE_OPTIONS
value: "--max-old-space-size=2048"
resources:
requests:
memory: 2Gi
cpu: 1
limits:
memory: 2Gi
cpu: 1
elasticsearchRef:
name: "esdev"
---
#APM server, with RUM enabled
apiVersion: apm.k8s.elastic.co/v1
kind: ApmServer
metadata:
name: apmdev
namespace: devoops
spec:
version: 8.15.3
count: 1
config:
apm-server.auth.secret_token: "devoops!"
apm-server.kibana.path: "/kibana"
apm-server.ssl.enabled: false
apm-server.kibana.ssl.enabled: false
apm-server.kibana.username: "elastic"
apm-server.kibana.password: "elastic" #TODO , get this from secrets
apm-server.rum.enabled: true
apm-server.rum.allow_origins: [ '*' ]
apm-server.rum.library_pattern: "node_modules|bower_components|~"
apm-server.rum.exclude_from_grouping: "^/webpack"
apm-server.rum.source_mapping.enabled: true
apm-server.rum.source_mapping.cache.expiration: 5m
apm-server.rum.source_mapping.index_pattern: "apm-*-sourcemap*"
http:
tls:
selfSignedCertificate:
disabled: true
podTemplate:
spec:
containers:
- name: apm-server
resources:
requests:
memory: 2Gi
cpu: 1
limits:
memory: 2Gi
cpu: 1
elasticsearchRef:
name: "esdev"
# this allows ECK to configure automatically the Kibana endpoint as described in https://www.elastic.co/guide/en/apm/server/current/setup-kibana-endpoint.html
kibanaRef:
name: "kbdev"
---
#File beat with SSL disabled
apiVersion: beat.k8s.elastic.co/v1beta1
kind: Beat
metadata:
name: beatdev
namespace: devoops
spec:
type: filebeat
version: 8.15.3
elasticsearchRef:
name: esdev
kibanaRef:
name: kbdev
config:
setup.kibana.path: /kibana
setup.kibana.ssl.enabled: false
filebeat:
ssl:
verificationMode: none
autodiscover:
providers:
- type: kubernetes
node: ${NODE_NAME}
hints:
enabled: true
default_config:
type: container
paths:
- /var/log/containers/*${data.kubernetes.container.id}.log
processors:
- drop_event:
when:
or:
- equals:
kubernetes.namespace: "kube-system"
- equals:
kubernetes.namespace: "elastic-system"
- equals:
kubernetes.namespace: "devoops"
- regexp:
kubernetes.pod.name: "ingress-nginx-*"
- add_cloud_metadata: {}
- add_host_metadata: {}
daemonSet:
podTemplate:
spec:
serviceAccountName: filebeat
automountServiceAccountToken: true
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: true # Allows to provide richer host metadata
containers:
- name: filebeat
securityContext:
runAsUser: 0
volumeMounts:
- name: varlogcontainers
mountPath: /var/log/containers
- name: varlogpods
mountPath: /var/log/pods
- name: varlibdockercontainers
mountPath: /var/lib/docker/containers
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumes:
- name: varlogcontainers
hostPath:
path: /var/log/containers
- name: varlogpods
hostPath:
path: /var/log/pods
- name: varlibdockercontainers
hostPath:
path: /var/lib/docker/containers
---
#Filebeat cluster role
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: filebeat
namespace: devoops
rules:
- apiGroups: ['*']
resources: ['*']
verbs: ['*']
---
#Filebeat service account
apiVersion: v1
kind: ServiceAccount
metadata:
name: filebeat
namespace: devoops
---
#Role bindings for file beat
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: filebeat
namespace: devoops
subjects:
- kind: ServiceAccount
name: filebeat
namespace: devoops
roleRef:
kind: ClusterRole
name: filebeat
apiGroup: rbac.authorization.k8s.io
---
#Ingress for Kibana
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: kbdev-kb-http-ingress
namespace: devoops
spec:
ingressClassName: nginx
rules:
- host: kubernetes.docker.internal
http:
paths:
- backend:
service:
name: kbdev-kb-http
port:
number: 5601
path: /kibana
pathType: Prefix
---
#Ingress for APM http server
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: apm-http-ingress
namespace: devoops
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
ingressClassName: nginx
rules:
- host: kubernetes.docker.internal
http:
paths:
- backend:
service:
name: apmdev-apm-http
port:
number: 8200
path: /apm(/|$)(.*)
pathType: ImplementationSpecific