Skip to content

Commit a4f2108

Browse files
authored
fix: logging stack (#5)
Port of stackabletech/stackablectl#294
1 parent de711fc commit a4f2108

File tree

3 files changed

+63
-43
lines changed

3 files changed

+63
-43
lines changed

stacks/_templates/opensearch-dashboards.yaml

-43
Original file line numberDiff line numberDiff line change
@@ -20,46 +20,3 @@ options:
2020
secretKeyRef:
2121
name: opensearch-user
2222
key: password
23-
lifecycle:
24-
postStart:
25-
exec:
26-
command:
27-
- bash
28-
- -c
29-
- |
30-
#!/bin/bash
31-
curl \
32-
--retry-connrefused \
33-
--retry 120 \
34-
--retry-delay 5 \
35-
--header "Content-Type:application/json" \
36-
--header "osd-xsrf:true" \
37-
--header "securitytenant: global" \
38-
--data '{
39-
"attributes": {
40-
"title": "vector-*",
41-
"timeFieldName": "timestamp"
42-
}
43-
}' \
44-
"http://admin:${OPEN_SEARCH_ADMIN_PASSWORD}@127.0.0.1:5601/api/saved_objects/index-pattern/vector-*"
45-
curl \
46-
--header "Content-Type:application/json" \
47-
--header "osd-xsrf:true" \
48-
--header "securitytenant: global" \
49-
--data '{
50-
"attributes": {
51-
"title":"Logs",
52-
"columns": ["pod", "container", "logger", "level", "message"],
53-
"kibanaSavedObjectMeta": {
54-
"searchSourceJSON": "{\"indexRefName\": \"kibanaSavedObjectMeta.searchSourceJSON.index\"}"
55-
}
56-
},
57-
"references": [
58-
{
59-
"id": "vector-*",
60-
"name": "kibanaSavedObjectMeta.searchSourceJSON.index",
61-
"type": "index-pattern"
62-
}
63-
]
64-
}' \
65-
http://admin:${OPEN_SEARCH_ADMIN_PASSWORD}@127.0.0.1:5601/api/saved_objects/search/logs
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
apiVersion: batch/v1
3+
kind: Job
4+
metadata:
5+
name: setup-opensearch-dashboards
6+
spec:
7+
template:
8+
spec:
9+
containers:
10+
- name: setup-opensearch-dashboards
11+
image: docker.stackable.tech/stackable/testing-tools:0.2.0-stackable23.11.0
12+
env:
13+
- name: OPEN_SEARCH_ADMIN_PASSWORD
14+
valueFrom:
15+
secretKeyRef:
16+
name: opensearch-user
17+
key: password
18+
command:
19+
- bash
20+
- -x
21+
- -euo
22+
- pipefail
23+
- -c
24+
- |
25+
#!/bin/bash
26+
curl \
27+
--retry-connrefused \
28+
--retry 120 \
29+
--retry-delay 5 \
30+
--header "Content-Type:application/json" \
31+
--header "osd-xsrf:true" \
32+
--header "securitytenant: global" \
33+
--data '{
34+
"attributes": {
35+
"title": "vector-*",
36+
"timeFieldName": "timestamp"
37+
}
38+
}' \
39+
"http://admin:${OPEN_SEARCH_ADMIN_PASSWORD}@opensearch-dashboards:5601/api/saved_objects/index-pattern/vector-*"
40+
curl \
41+
--header "Content-Type:application/json" \
42+
--header "osd-xsrf:true" \
43+
--header "securitytenant: global" \
44+
--data '{
45+
"attributes": {
46+
"title":"Logs",
47+
"columns": ["pod", "container", "logger", "level", "message"],
48+
"kibanaSavedObjectMeta": {
49+
"searchSourceJSON": "{\"indexRefName\": \"kibanaSavedObjectMeta.searchSourceJSON.index\"}"
50+
}
51+
},
52+
"references": [
53+
{
54+
"id": "vector-*",
55+
"name": "kibanaSavedObjectMeta.searchSourceJSON.index",
56+
"type": "index-pattern"
57+
}
58+
]
59+
}' \
60+
http://admin:${OPEN_SEARCH_ADMIN_PASSWORD}@opensearch-dashboards:5601/api/saved_objects/search/logs
61+
restartPolicy: OnFailure
62+
backoffLimit: 50

stacks/stacks-v2.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ stacks:
3636
manifests:
3737
- helmChart: https://raw.githubusercontent.com/stackabletech/demos/main/stacks/_templates/opensearch.yaml
3838
- helmChart: https://raw.githubusercontent.com/stackabletech/demos/main/stacks/_templates/opensearch-dashboards.yaml
39+
- plainYaml: https://raw.githubusercontent.com/stackabletech/demos/main/stacks/logging/setup-opensearch-dashboards.yaml
3940
- helmChart: https://raw.githubusercontent.com/stackabletech/demos/main/stacks/_templates/vector-aggregator.yaml
4041
- plainYaml: https://raw.githubusercontent.com/stackabletech/demos/main/stacks/_templates/vector-aggregator-discovery.yaml
4142
supportedNamespaces: []

0 commit comments

Comments
 (0)