From ed46799948430a352bbf8f6cb5af0ac3b7e15a85 Mon Sep 17 00:00:00 2001 From: Joe Monk Date: Thu, 25 Jan 2024 23:33:05 +0000 Subject: [PATCH] Update yamls for prom stack --- .../kube-state-metrics-config.yaml | 13 ++++---- .../kube-prometheus-stack/kustomization.yaml | 2 +- .../kube-prometheus-stack/release.yaml | 31 ++++++------------- .../controllers/loki-stack/release.yaml | 4 +-- 4 files changed, 20 insertions(+), 30 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 bd216a0..d06c954 100644 --- a/monitoring/controllers/kube-prometheus-stack/kube-state-metrics-config.yaml +++ b/monitoring/controllers/kube-prometheus-stack/kube-state-metrics-config.yaml @@ -1,4 +1,7 @@ kube-state-metrics: + # For kube-prometheus-stacks that are already installed and configured with + # custom collectors, commenting out the collectors and extraArgs below will + # retain any existing kube-state-metrics configuration. collectors: [ ] extraArgs: - --custom-resource-state-only=true @@ -51,7 +54,7 @@ kube-state-metrics: source_name: [ spec, sourceRef, name ] - groupVersionKind: group: helm.toolkit.fluxcd.io - version: v2beta1 + version: v2beta2 kind: HelmRelease metricNamePrefix: gotk metrics: @@ -168,7 +171,7 @@ kube-state-metrics: url: [ spec, url ] - groupVersionKind: group: notification.toolkit.fluxcd.io - version: v1beta2 + version: v1beta3 kind: Alert metricNamePrefix: gotk metrics: @@ -181,11 +184,10 @@ kube-state-metrics: name: [ metadata, name ] labelsFromPath: exported_namespace: [ metadata, namespace ] - ready: [ status, conditions, "[type=Ready]", status ] suspended: [ spec, suspend ] - groupVersionKind: group: notification.toolkit.fluxcd.io - version: v1beta2 + version: v1beta3 kind: Provider metricNamePrefix: gotk metrics: @@ -198,7 +200,6 @@ kube-state-metrics: name: [ metadata, name ] labelsFromPath: exported_namespace: [ metadata, namespace ] - ready: [ status, conditions, "[type=Ready]", status ] suspended: [ spec, suspend ] - groupVersionKind: group: notification.toolkit.fluxcd.io @@ -271,4 +272,4 @@ kube-state-metrics: exported_namespace: [ metadata, namespace ] ready: [ status, conditions, "[type=Ready]", status ] suspended: [ spec, suspend ] - source_name: [ spec, sourceRef, name ] + source_name: [ spec, sourceRef, name ] \ No newline at end of file diff --git a/monitoring/controllers/kube-prometheus-stack/kustomization.yaml b/monitoring/controllers/kube-prometheus-stack/kustomization.yaml index d39eb9f..8bdf012 100644 --- a/monitoring/controllers/kube-prometheus-stack/kustomization.yaml +++ b/monitoring/controllers/kube-prometheus-stack/kustomization.yaml @@ -14,4 +14,4 @@ configMapGenerator: app.kubernetes.io/part-of: flux app.kubernetes.io/component: monitoring configurations: - - kustomizeconfig.yaml + - kustomizeconfig.yaml \ No newline at end of file diff --git a/monitoring/controllers/kube-prometheus-stack/release.yaml b/monitoring/controllers/kube-prometheus-stack/release.yaml index f1a848e..575fcad 100644 --- a/monitoring/controllers/kube-prometheus-stack/release.yaml +++ b/monitoring/controllers/kube-prometheus-stack/release.yaml @@ -1,4 +1,4 @@ -apiVersion: helm.toolkit.fluxcd.io/v2beta1 +apiVersion: helm.toolkit.fluxcd.io/v2beta2 kind: HelmRelease metadata: name: kube-prometheus-stack @@ -6,7 +6,7 @@ spec: interval: 1h chart: spec: - version: "48.x" + version: "55.x" chart: kube-prometheus-stack sourceRef: kind: HelmRepository @@ -16,6 +16,13 @@ spec: crds: Create upgrade: crds: CreateReplace + driftDetection: + mode: enabled + ignore: + # Ignore "validated" annotation which is not inserted during install + - paths: [ "/metadata/annotations/prometheus-operator-validated" ] + target: + kind: PrometheusRule valuesFrom: - kind: ConfigMap name: flux-kube-state-metrics-config @@ -37,22 +44,4 @@ spec: app.kubernetes.io/component: monitoring grafana: defaultDashboardsEnabled: false - adminPassword: flux - postRenderers: - - kustomize: - patches: - - target: - # Ignore these objects from Flux diff as they are mutated from chart hooks - kind: (ValidatingWebhookConfiguration|MutatingWebhookConfiguration) - name: kube-prometheus-stack-admission - patch: | - - op: add - path: /metadata/annotations/helm.toolkit.fluxcd.io~1driftDetection - value: disabled - - target: - # Ignore these objects from Flux diff as they are mutated at apply time but not at dry-run time - kind: PrometheusRule - patch: | - - op: add - path: /metadata/annotations/helm.toolkit.fluxcd.io~1driftDetection - value: disabled + adminPassword: flux \ No newline at end of file diff --git a/monitoring/controllers/loki-stack/release.yaml b/monitoring/controllers/loki-stack/release.yaml index 4bb4a2c..5003d8e 100644 --- a/monitoring/controllers/loki-stack/release.yaml +++ b/monitoring/controllers/loki-stack/release.yaml @@ -1,4 +1,4 @@ -apiVersion: helm.toolkit.fluxcd.io/v2beta1 +apiVersion: helm.toolkit.fluxcd.io/v2beta2 kind: HelmRelease metadata: name: loki-stack @@ -31,4 +31,4 @@ spec: max_look_back_period: 0s table_manager: retention_deletes_enabled: true - retention_period: 12h + retention_period: 12h \ No newline at end of file