Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
fix(prometheus): servicemonitor labels
Browse files Browse the repository at this point in the history
  • Loading branch information
Smana committed Sep 8, 2023
1 parent f1b4b48 commit cb245dd
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
6 changes: 6 additions & 0 deletions flux-config/base/prometheus/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: flux-system

resources:
- podmonitor.yaml
24 changes: 24 additions & 0 deletions flux-config/base/prometheus/podmonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: flux-system
namespace: flux-system
labels:
prometheus-instance: "main"
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:
- targetPort: http-prom
1 change: 1 addition & 0 deletions flux-config/mycluster-0/weave-gitops/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../base/prometheus
- ../../base/weave-gitops
10 changes: 8 additions & 2 deletions observability/base/kube-prometheus-stack/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
kind: HelmRepository
name: prometheus-community
namespace: flux-system
version: "50.0.0"
version: "50.3.1"
interval: 10m0s
timeout: 30m
install:
Expand All @@ -30,6 +30,9 @@ spec:
alertmanager:
enabled: false
grafana:
serviceMonitor:
labels:
prometheus-instance: main
admin:
existingSecret: "kube-prometheus-stack-grafana-admin"
defaultDashboardsEnabled: true
Expand Down Expand Up @@ -101,7 +104,6 @@ spec:
requests:
cpu: 100m
memory: 400Mi

prometheus:
configReloaderCpu: 300m
prometheusSpec:
Expand All @@ -127,3 +129,7 @@ spec:
limits:
cpu: 500m
memory: 1Gi
kubelet:
servicemonitor:
additionalLabels:
prometheus-instance: main

0 comments on commit cb245dd

Please sign in to comment.