feat(prometheus): Add self scraping
This commit is contained in:
parent
be41f0f010
commit
d7e14f9b35
@ -2,4 +2,6 @@ resources:
|
|||||||
- serviceaccount.yaml
|
- serviceaccount.yaml
|
||||||
- clusterrole.yaml
|
- clusterrole.yaml
|
||||||
- clusterrolebinding.yaml
|
- clusterrolebinding.yaml
|
||||||
|
- service.yaml
|
||||||
|
- servicemonitor.yaml
|
||||||
- prometheus.yaml
|
- prometheus.yaml
|
||||||
|
@ -7,6 +7,9 @@ spec:
|
|||||||
serviceAccountName: prometheus
|
serviceAccountName: prometheus
|
||||||
serviceMonitorNamespaceSelector: {}
|
serviceMonitorNamespaceSelector: {}
|
||||||
serviceMonitorSelector: {}
|
serviceMonitorSelector: {}
|
||||||
|
podMonitorSelector:
|
||||||
|
matchLabels:
|
||||||
|
team: core
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
memory: 300Mi
|
memory: 300Mi
|
||||||
|
16
manifests/prometheus/service.yaml
Normal file
16
manifests/prometheus/service.yaml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: prometheus-svc
|
||||||
|
namespace: monitoring
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: prometheus
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: web
|
||||||
|
port: 9090
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: web
|
||||||
|
selector:
|
||||||
|
app.kubernetes.io/name: prometheus
|
||||||
|
|
14
manifests/prometheus/servicemonitor.yaml
Normal file
14
manifests/prometheus/servicemonitor.yaml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: ServiceMonitor
|
||||||
|
metadata:
|
||||||
|
name: prometheus
|
||||||
|
namespace: monitoring
|
||||||
|
labels:
|
||||||
|
team: core
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: prometheus
|
||||||
|
endpoints:
|
||||||
|
- port: web
|
||||||
|
path: /metrics
|
Loading…
Reference in New Issue
Block a user