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:
2026-01-04 14:35:08 +09:00
parent 699b31cc67
commit 997893284b
3 changed files with 28 additions and 7 deletions

View File

@@ -13,13 +13,6 @@ resources:
cpu: 10m cpu: 10m
memory: 32Mi memory: 32Mi
# Prometheus ServiceMonitor 설정
serviceMonitor:
enabled: true
additionalLabels:
release: prometheus
namespace: prometheus
# Disable default config - use secret instead # Disable default config - use secret instead
config: config:
enabled: false enabled: false

View File

@@ -2,4 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- ingress.yaml - ingress.yaml
- servicemonitor.yaml
- vault/alertmanager-secrets.yaml - vault/alertmanager-secrets.yaml

View 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