forked from ricoberger/script_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kubernetes.yaml
104 lines (97 loc) · 2.34 KB
/
kubernetes.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
---
apiVersion: v1
kind: Namespace
metadata:
name: script-exporter
---
kind: ConfigMap
apiVersion: v1
metadata:
name: script-exporter
namespace: script-exporter
labels:
app.kubernetes.io/name: script-exporter
data:
config.yaml: |
tls:
enabled: false
basicAuth:
enabled: false
bearerAuth:
enabled: false
scripts:
- name: test
script: sh /etc/script_exporter/test.sh
test.sh: |
#! /bin/bash
echo "# HELP test_first_test"
echo "# TYPE test_first_test gauge"
echo "first_test{label=\"test_1_label_1\"} 1"
echo ""
echo "# HELP test_second_test"
echo "# TYPE test_second_test gauge"
echo "second_test{label=\"test_2_label_1\",label=\"test_2_label_2\"} 2.71828182846"
echo ""
echo "# HELP test_third_test"
echo "# TYPE test_third_test gauge"
echo "third_test{} 3,14159265359"
echo ""
echo "Fourth test"
echo "fourth label=\"test_1_label_1\ 4"
echo ""
echo "Fifth test"
echo "fifth 5"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: script-exporter
namespace: script-exporter
labels:
app.kubernetes.io/name: script-exporter
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: script-exporter
template:
metadata:
labels:
app.kubernetes.io/name: script-exporter
spec:
containers:
- name: script-exporter
image: ricoberger/script_exporter:v2.1.1
args:
- -config.file=/etc/script_exporter/config.yaml
ports:
- name: http
containerPort: 9469
protocol: TCP
livenessProbe:
failureThreshold: 3
httpGet:
path: /
port: 9469
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 10
readinessProbe:
failureThreshold: 3
httpGet:
path: /
port: 9469
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 10
volumeMounts:
- name: config
mountPath: /etc/script_exporter
volumes:
- name: config
configMap:
name: script-exporter
defaultMode: 0777