FEAT(alertmanager): add ServiceMonitor
- Create servicemonitor.yaml for Prometheus to scrape Alertmanager - alertmanager chart does not include ServiceMonitor, must be added separately - Enables Grafana Alertmanager dashboard to display data
This commit is contained in:
@@ -13,13 +13,6 @@ resources:
|
||||
cpu: 10m
|
||||
memory: 32Mi
|
||||
|
||||
# Prometheus ServiceMonitor 설정
|
||||
serviceMonitor:
|
||||
enabled: true
|
||||
additionalLabels:
|
||||
release: prometheus
|
||||
namespace: prometheus
|
||||
|
||||
# Disable default config - use secret instead
|
||||
config:
|
||||
enabled: false
|
||||
|
||||
@@ -2,4 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- ingress.yaml
|
||||
- servicemonitor.yaml
|
||||
- vault/alertmanager-secrets.yaml
|
||||
|
||||
27
alertmanager/servicemonitor.yaml
Normal file
27
alertmanager/servicemonitor.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: alertmanager
|
||||
namespace: prometheus
|
||||
labels:
|
||||
release: prometheus
|
||||
spec:
|
||||
endpoints:
|
||||
- port: http
|
||||
path: /metrics
|
||||
scheme: http
|
||||
interval: 60s
|
||||
relabelings:
|
||||
- targetLabel: cluster
|
||||
replacement: "mayne-cluster"
|
||||
# Drop alertmanager-headless to avoid duplicate metrics
|
||||
- sourceLabels: [__meta_kubernetes_service_name]
|
||||
regex: alertmanager-headless
|
||||
action: drop
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- alertmanager
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/instance: alertmanager
|
||||
app.kubernetes.io/name: alertmanager
|
||||
Reference in New Issue
Block a user