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..f6f4e10 --- /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: + - lightmare + endpoints: + - port: metrics + scheme: http 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: