From bdce88ad7b8aa73db8e7e2ba1df342911692cf34 Mon Sep 17 00:00:00 2001 From: enjenjenje Date: Mon, 17 Feb 2025 14:02:29 +0100 Subject: [PATCH 1/3] added lightmare monitoring be default --- .../monitoring/controllers/kube-prometheus-stack/release.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flux/components/monitoring/controllers/kube-prometheus-stack/release.yaml b/flux/components/monitoring/controllers/kube-prometheus-stack/release.yaml index 2a5c2be..352a684 100644 --- a/flux/components/monitoring/controllers/kube-prometheus-stack/release.yaml +++ b/flux/components/monitoring/controllers/kube-prometheus-stack/release.yaml @@ -32,7 +32,7 @@ spec: enabled: false prometheus: prometheusSpec: - retention: 24h + retention: 168h resources: requests: cpu: 200m @@ -48,6 +48,7 @@ spec: - "kube-state-metrics" - "prometheus-node-exporter" - "spectrum-monitoring" + - "lightmare" podMonitorNamespaceSelector: {} podMonitorSelector: From a925dae5ea1642eb8dd5ca65bbb5c41adb9e50ef Mon Sep 17 00:00:00 2001 From: enjenjenje Date: Mon, 17 Feb 2025 14:40:14 +0100 Subject: [PATCH 2/3] added specs to enable lightmare monitoring --- .../monitoring/configs/kustomization.yml | 1 + .../monitoring/configs/lightmare.yml | 16 ++++++++++++++++ .../configs/lightmare/kustomization.yml | 19 +++++++++++++++++++ .../configs/lightmare/service-monitor.yml | 17 +++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 flux/components/monitoring/configs/lightmare.yml create mode 100644 flux/components/monitoring/configs/lightmare/kustomization.yml create mode 100644 flux/components/monitoring/configs/lightmare/service-monitor.yml diff --git a/flux/components/monitoring/configs/kustomization.yml b/flux/components/monitoring/configs/kustomization.yml index 88ed8b0..99bda9a 100644 --- a/flux/components/monitoring/configs/kustomization.yml +++ b/flux/components/monitoring/configs/kustomization.yml @@ -5,3 +5,4 @@ resources: - system - kubernetes - kubevirt.yml + - lightmare.yml diff --git a/flux/components/monitoring/configs/lightmare.yml b/flux/components/monitoring/configs/lightmare.yml new file mode 100644 index 0000000..2e49e81 --- /dev/null +++ b/flux/components/monitoring/configs/lightmare.yml @@ -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 diff --git a/flux/components/monitoring/configs/lightmare/kustomization.yml b/flux/components/monitoring/configs/lightmare/kustomization.yml new file mode 100644 index 0000000..b9dec98 --- /dev/null +++ b/flux/components/monitoring/configs/lightmare/kustomization.yml @@ -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 diff --git a/flux/components/monitoring/configs/lightmare/service-monitor.yml b/flux/components/monitoring/configs/lightmare/service-monitor.yml new file mode 100644 index 0000000..8dfeeca --- /dev/null +++ b/flux/components/monitoring/configs/lightmare/service-monitor.yml @@ -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: + - kubevirt + endpoints: + - port: metrics + scheme: http From b920fb2f9a69f47740f6056feefdbcd7b993d744 Mon Sep 17 00:00:00 2001 From: enjenjenje Date: Mon, 17 Feb 2025 14:41:30 +0100 Subject: [PATCH 3/3] added specs to enable lightmare monitoring --- .../components/monitoring/configs/lightmare/service-monitor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flux/components/monitoring/configs/lightmare/service-monitor.yml b/flux/components/monitoring/configs/lightmare/service-monitor.yml index 8dfeeca..f6f4e10 100644 --- a/flux/components/monitoring/configs/lightmare/service-monitor.yml +++ b/flux/components/monitoring/configs/lightmare/service-monitor.yml @@ -11,7 +11,7 @@ spec: app: lightmare namespaceSelector: matchNames: - - kubevirt + - lightmare endpoints: - port: metrics scheme: http