-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathk8s-config.yaml
59 lines (59 loc) · 975 Bytes
/
k8s-config.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
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nodeapp
labels:
app: nodeapp
spec:
selector:
matchLabels:
app: nodeapp
template:
metadata:
labels:
app: nodeapp
spec:
imagePullSecrets:
- name: docker-hub-key
containers:
- name: nodeapp
image: 977977/node-prometheus
ports:
- containerPort: 3000
imagePullPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
name: nodeapp
labels:
app: nodeapp
spec:
type: ClusterIP
selector:
app: nodeapp
ports:
- name: service
protocol: TCP
port: 3000
targetPort: 3000
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: monitoring-node-app
labels:
release: monitoring
app: nodeapp
spec:
endpoints:
- path: /metrics
port: service
targetPort: 3000
namespaceSelector:
matchNames:
- default
selector:
matchLabels:
app: nodeapp