From 87923b0b0746dc51b3cb91f348d012671aa5a2bb Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Tue, 7 May 2024 09:59:12 +0300 Subject: [PATCH 1/3] Update to `HelmRelease` v2 API Signed-off-by: Stefan Prodan --- .../controllers/kube-prometheus-stack/release.yaml | 13 ++++--------- .../kube-prometheus-stack/repository.yaml | 14 +++++++++----- monitoring/controllers/loki-stack/release.yaml | 2 +- monitoring/controllers/loki-stack/repository.yaml | 2 +- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/monitoring/controllers/kube-prometheus-stack/release.yaml b/monitoring/controllers/kube-prometheus-stack/release.yaml index 3302d1b..1f9263f 100644 --- a/monitoring/controllers/kube-prometheus-stack/release.yaml +++ b/monitoring/controllers/kube-prometheus-stack/release.yaml @@ -1,17 +1,12 @@ -apiVersion: helm.toolkit.fluxcd.io/v2beta2 +apiVersion: helm.toolkit.fluxcd.io/v2 kind: HelmRelease metadata: name: kube-prometheus-stack spec: interval: 1h - chart: - spec: - version: "58.x" - chart: kube-prometheus-stack - sourceRef: - kind: HelmRepository - name: prometheus-community - interval: 1h + chartRef: + kind: OCIRepository + name: kube-prometheus-stack install: crds: Create upgrade: diff --git a/monitoring/controllers/kube-prometheus-stack/repository.yaml b/monitoring/controllers/kube-prometheus-stack/repository.yaml index f14b884..7a1f809 100644 --- a/monitoring/controllers/kube-prometheus-stack/repository.yaml +++ b/monitoring/controllers/kube-prometheus-stack/repository.yaml @@ -1,8 +1,12 @@ apiVersion: source.toolkit.fluxcd.io/v1beta2 -kind: HelmRepository +kind: OCIRepository metadata: - name: prometheus-community + name: kube-prometheus-stack spec: - interval: 12h - type: oci - url: oci://ghcr.io/prometheus-community/charts + interval: 1h + url: oci://ghcr.io/prometheus-community/charts/kube-prometheus-stack + ref: + semver: "58.x" + layerSelector: + mediaType: "application/vnd.cncf.helm.chart.content.v1.tar+gzip" + operation: copy diff --git a/monitoring/controllers/loki-stack/release.yaml b/monitoring/controllers/loki-stack/release.yaml index dbd30f5..52a7c0c 100644 --- a/monitoring/controllers/loki-stack/release.yaml +++ b/monitoring/controllers/loki-stack/release.yaml @@ -1,4 +1,4 @@ -apiVersion: helm.toolkit.fluxcd.io/v2beta2 +apiVersion: helm.toolkit.fluxcd.io/v2 kind: HelmRelease metadata: name: loki-stack diff --git a/monitoring/controllers/loki-stack/repository.yaml b/monitoring/controllers/loki-stack/repository.yaml index 49f58cd..d3e086e 100644 --- a/monitoring/controllers/loki-stack/repository.yaml +++ b/monitoring/controllers/loki-stack/repository.yaml @@ -1,4 +1,4 @@ -apiVersion: source.toolkit.fluxcd.io/v1beta2 +apiVersion: source.toolkit.fluxcd.io/v1 kind: HelmRepository metadata: name: grafana-charts From 92443616799fa5bdc375dccdbcc6b1f82f79f869 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Tue, 7 May 2024 09:59:37 +0300 Subject: [PATCH 2/3] Add `chart_app_version` to `HelmRelease` metrics Signed-off-by: Stefan Prodan --- .../kube-prometheus-stack/kube-state-metrics-config.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/monitoring/controllers/kube-prometheus-stack/kube-state-metrics-config.yaml b/monitoring/controllers/kube-prometheus-stack/kube-state-metrics-config.yaml index fa8b091..4f2818d 100644 --- a/monitoring/controllers/kube-prometheus-stack/kube-state-metrics-config.yaml +++ b/monitoring/controllers/kube-prometheus-stack/kube-state-metrics-config.yaml @@ -69,8 +69,10 @@ kube-state-metrics: exported_namespace: [ metadata, namespace ] ready: [ status, conditions, "[type=Ready]", status ] suspended: [ spec, suspend ] - revision: [ status, lastAppliedRevision ] - chart_name: [ spec, chart, spec, chart ] + revision: [ status, history, "0", chartVersion ] + chart_name: [ status, history, "0", chartName ] + chart_app_version: [ status, history, "0", appVersion ] + chart_ref_name: [ spec, chartRef, name ] chart_source_name: [ spec, chart, spec, sourceRef, name ] - groupVersionKind: group: source.toolkit.fluxcd.io From 35953ba7ea6cfc7866a4531180e8a47cdc16ef11 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Tue, 7 May 2024 10:02:08 +0300 Subject: [PATCH 3/3] Update metrics to GA APIs Signed-off-by: Stefan Prodan --- .../kube-prometheus-stack/kube-state-metrics-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/monitoring/controllers/kube-prometheus-stack/kube-state-metrics-config.yaml b/monitoring/controllers/kube-prometheus-stack/kube-state-metrics-config.yaml index 4f2818d..9918b20 100644 --- a/monitoring/controllers/kube-prometheus-stack/kube-state-metrics-config.yaml +++ b/monitoring/controllers/kube-prometheus-stack/kube-state-metrics-config.yaml @@ -54,7 +54,7 @@ kube-state-metrics: source_name: [ spec, sourceRef, name ] - groupVersionKind: group: helm.toolkit.fluxcd.io - version: v2beta2 + version: v2 kind: HelmRelease metricNamePrefix: gotk metrics: @@ -115,7 +115,7 @@ kube-state-metrics: bucket_name: [ spec, bucketName ] - groupVersionKind: group: source.toolkit.fluxcd.io - version: v1beta2 + version: v1 kind: HelmRepository metricNamePrefix: gotk metrics: @@ -134,7 +134,7 @@ kube-state-metrics: url: [ spec, url ] - groupVersionKind: group: source.toolkit.fluxcd.io - version: v1beta2 + version: v1 kind: HelmChart metricNamePrefix: gotk metrics: