add fluxcd prometheus scrapping

This commit is contained in:
Márcio Fernandes
2026-07-15 13:13:54 +00:00
parent 0c5013f156
commit 310f4e00f9
3 changed files with 39 additions and 2 deletions
+7
View File
@@ -23,3 +23,10 @@ helm upgrade flux-operator oci://ghcr.io/controlplaneio-fluxcd/charts/flux-opera
--create-namespace
kubectl apply -f ./deploy/fluxsystem.yaml
```
**Allow prometheus scrapping:**
```bash
kubectl apply -f deploy/monitoring
kubectl label ns flux-system prometheus-monitoring=enabled
```
@@ -0,0 +1,25 @@
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: flux-system
namespace: flux-system
labels:
app.kubernetes.io/part-of: flux
app.kubernetes.io/component: monitoring
spec:
namespaceSelector:
matchNames:
- flux-system
selector:
matchExpressions:
- key: app
operator: In
values:
- helm-controller
- source-controller
- kustomize-controller
- notification-controller
- image-automation-controller
- image-reflector-controller
podMetricsEndpoints:
- port: http-prom
@@ -9,8 +9,13 @@ spec:
prometheus-monitoring: enabled
podMonitorSelector:
matchLabels:
release: prometheus
matchExpressions:
- key: release
operator: In
values: ["prometheus"]
- key: prometheus.io/scrape
operator: In
values: ["true"]
serviceMonitorNamespaceSelector:
matchLabels: