Skip to content

Commit

Permalink
chore: prometheus monitoring tune (#133)
Browse files Browse the repository at this point in the history
* increased metric retention up to a week
* added lightmare monitoring by default
* added specs to enable lightmare monitoring
  • Loading branch information
enjenjenje authored Feb 17, 2025
1 parent 0f957b9 commit eeacc5d
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 1 deletion.
1 change: 1 addition & 0 deletions flux/components/monitoring/configs/kustomization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ resources:
- system
- kubernetes
- kubevirt.yml
- lightmare.yml
16 changes: 16 additions & 0 deletions flux/components/monitoring/configs/lightmare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: lightmare-monitoring
namespace: flux-system
spec:
interval: 1m0s
path: ./flux/components/monitoring/configs/lightmare
prune: true
sourceRef:
kind: GitRepository
name: spectrum
namespace: flux-system
dependsOn:
- name: lightmare
namespace: flux-system
19 changes: 19 additions & 0 deletions flux/components/monitoring/configs/lightmare/kustomization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: monitoring
resources:
- service-monitor.yml
generatorOptions:
disableNameSuffixHash: true
labels:
grafana_dashboard: "1"
app.kubernetes.io/part-of: spectrum-monitoring
app.kubernetes.io/component: lightmare
commonAnnotations:
grafana_folder: "lightmare"

# tbd
# configMapGenerator:
# - name: dashboards-k8s-lightmare
# files:
# - *.json
17 changes: 17 additions & 0 deletions flux/components/monitoring/configs/lightmare/service-monitor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: lightmare
labels:
app.kubernetes.io/part-of: spectrum-monitoring
app.kubernetes.io/component: lightmare
spec:
selector:
matchLabels:
app: lightmare
namespaceSelector:
matchNames:
- lightmare
endpoints:
- port: metrics
scheme: http
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
enabled: false
prometheus:
prometheusSpec:
retention: 24h
retention: 168h
resources:
requests:
cpu: 200m
Expand All @@ -48,6 +48,7 @@ spec:
- "kube-state-metrics"
- "prometheus-node-exporter"
- "spectrum-monitoring"
- "lightmare"

podMonitorNamespaceSelector: {}
podMonitorSelector:
Expand Down

0 comments on commit eeacc5d

Please sign in to comment.