-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkubernetes-monitor.yaml
114 lines (103 loc) · 2.01 KB
/
kubernetes-monitor.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
105
106
107
108
109
110
111
112
113
114
---
apiVersion: v1
kind: Service
metadata:
name: grafana-service
labels:
operations: monitoring-dashboard
spec:
selector:
app: grafana-deployment
ports:
- protocol: TCP
name: http
port: 80
targetPort: 3000
---
# Persist the Grafana data
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: grafana-data
labels:
app: grafana
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
# This pod is separated from the scrapper and does not
# have any critical role, nor expected frequently updates,
# so it is fine to use a pod.
apiVersion: v1
kind: Pod
metadata:
name: grafana-deployment
labels:
app: grafana
operations: monitoring-dashboard
spec:
containers:
- image: grafana/grafana
imagePullPolicy: Always
name: grafana-deployment-dashboard
ports:
- containerPort: 3000
protocol: TCP
resources:
requests:
cpu: 100m
volumeMounts:
- name: grafana-persistent-storage
mountPath: /var/lib/grafana
securityContext:
fsGroup: 472
volumes:
- name: grafana-persistent-storage
persistentVolumeClaim:
claimName: grafana-data
---
kind: Service
apiVersion: v1
metadata:
name: prometheus-service
labels:
app: prometheus
operations: target-scrapper
spec:
selector:
app: prometheus-deployment
ports:
- protocol: TCP
name: http
port: 80
targetPort: 9090
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: prometheus-deployment
labels:
operations: target-scrapper
spec:
replicas: 1
selector:
matchLabels:
operations: target-scrapper
template:
metadata:
labels:
operations: target-scrapper
spec:
containers:
- image: prom/prometheus
imagePullPolicy: Always
name: prometheus
ports:
- containerPort: 9090
protocol: TCP
resources:
requests:
cpu: 100m