feat(prometheus): Add self scraping

This commit is contained in:
Tanguy Herbron 2023-07-29 09:44:09 +02:00
parent be41f0f010
commit d7e14f9b35
4 changed files with 35 additions and 0 deletions

View File

@ -2,4 +2,6 @@ resources:
- serviceaccount.yaml
- clusterrole.yaml
- clusterrolebinding.yaml
- service.yaml
- servicemonitor.yaml
- prometheus.yaml

View File

@ -7,6 +7,9 @@ spec:
serviceAccountName: prometheus
serviceMonitorNamespaceSelector: {}
serviceMonitorSelector: {}
podMonitorSelector:
matchLabels:
team: core
resources:
requests:
memory: 300Mi

View 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

View 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