setup service monitor for prometheus and alertanager
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
|
labels:
|
||||||
|
alertmanager: main
|
||||||
name: alertmanager-main
|
name: alertmanager-main
|
||||||
spec:
|
spec:
|
||||||
type: NodePort
|
type: NodePort
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
|
labels:
|
||||||
|
prometheus: k8s
|
||||||
name: prometheus-k8s
|
name: prometheus-k8s
|
||||||
spec:
|
spec:
|
||||||
type: NodePort
|
type: NodePort
|
||||||
|
|||||||
@@ -44,3 +44,29 @@ spec:
|
|||||||
interval: 15s
|
interval: 15s
|
||||||
- port: http-metrics-skydns
|
- port: http-metrics-skydns
|
||||||
interval: 15s
|
interval: 15s
|
||||||
|
---
|
||||||
|
apiVersion: monitoring.coreos.com/v1alpha1
|
||||||
|
kind: ServiceMonitor
|
||||||
|
metadata:
|
||||||
|
name: prometheus
|
||||||
|
labels:
|
||||||
|
prometheus: k8s
|
||||||
|
spec:
|
||||||
|
endpoints:
|
||||||
|
- port: web
|
||||||
|
selector:
|
||||||
|
matchExpressions:
|
||||||
|
- {key: prometheus, operator: In, values: [k8s]}
|
||||||
|
---
|
||||||
|
apiVersion: monitoring.coreos.com/v1alpha1
|
||||||
|
kind: ServiceMonitor
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
alertmanager: main
|
||||||
|
name: alertmanager
|
||||||
|
spec:
|
||||||
|
endpoints:
|
||||||
|
- port: web
|
||||||
|
selector:
|
||||||
|
matchExpressions:
|
||||||
|
- {key: alertmanager, operator: In, values: [main]}
|
||||||
Reference in New Issue
Block a user