-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex-patterns-cronjob.yml
46 lines (45 loc) · 1.45 KB
/
index-patterns-cronjob.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
# Copyright (c) 2022 SIGHUP s.r.l All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: index-patterns-cronjob
spec:
jobTemplate:
spec:
template:
metadata:
labels:
app.kubernetes.io/name: opensearch-dashboards
app.kubernetes.io/instance: opensearch-dashboards
spec:
containers:
- name: index-patterns
securityContext:
capabilities:
drop:
- ALL
runAsNonRoot: true
runAsUser: 1000
image: opensearchproject/opensearch-dashboards
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- |
curl -X POST "http://opensearch-dashboards:5601/api/saved_objects/_import?overwrite=true" -H "osd-xsrf: true" --form file=@/tmp/index-patterns.ndjson
volumeMounts:
- name: config-volume
mountPath: /tmp/index-patterns.ndjson
subPath: index-patterns.ndjson
volumes:
- name: config-volume
configMap:
name: opensearch-index-patterns
items:
- key: index-patterns.ndjson
path: index-patterns.ndjson
restartPolicy: OnFailure
schedule: "0 * * * *"