From cd2bceec3a22aff9136defff0ce185a8c241c696 Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 4 Feb 2024 15:04:24 +0930 Subject: [PATCH] feat(thanos_sidecar): if enabled must also be configured for deploy to occur !8 --- templates/Prometheus-prometheus.yaml | 2 ++ templates/PrometheusRule-thanos.yaml | 4 +++- .../Secret-prometheus-sidecar-thanos.yaml | 2 ++ templates/ServiceMonitor-prometheus.yaml | 5 ++++- values.yaml | 19 ++++++++++--------- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/templates/Prometheus-prometheus.yaml b/templates/Prometheus-prometheus.yaml index 7c292af..ce80d2b 100644 --- a/templates/Prometheus-prometheus.yaml +++ b/templates/Prometheus-prometheus.yaml @@ -48,12 +48,14 @@ spec: storage: {{- toYaml .Values.nfc_monitoring.prometheus.storage | nindent 4 }} {{ if .Values.nfc_monitoring.thanos.sidecar.enabled }} + {{ if .Values.nfc_monitoring.thanos.sidecar.config }} thanos: image: "{{ .Values.nfc_monitoring.thanos.image.name }}:{{ .Values.nfc_monitoring.thanos.image.tag }}" objectStorageConfig: key: thanos.yaml name: thanos-sidecar-config {{ end }} + {{ end }} version: 2.42.0 {{ if .Values.nfc_monitoring.prometheus.additional }} {{ toYaml .Values.nfc_monitoring.prometheus.additional | nindent 2 }} diff --git a/templates/PrometheusRule-thanos.yaml b/templates/PrometheusRule-thanos.yaml index 2103d24..e3b8923 100644 --- a/templates/PrometheusRule-thanos.yaml +++ b/templates/PrometheusRule-thanos.yaml @@ -1,4 +1,5 @@ {{ if .Values.nfc_monitoring.thanos.sidecar.enabled }} +{{ if .Values.nfc_monitoring.thanos.sidecar.config }} --- apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule @@ -52,4 +53,5 @@ spec: labels: severity: critical -{{ end }} \ No newline at end of file +{{ end }} +{{ end }} diff --git a/templates/Secret-prometheus-sidecar-thanos.yaml b/templates/Secret-prometheus-sidecar-thanos.yaml index 024d8e8..418aecb 100644 --- a/templates/Secret-prometheus-sidecar-thanos.yaml +++ b/templates/Secret-prometheus-sidecar-thanos.yaml @@ -1,4 +1,5 @@ {{ if .Values.nfc_monitoring.thanos.sidecar.enabled }} +{{ if .Values.nfc_monitoring.thanos.sidecar.config }} --- apiVersion: v1 kind: Secret @@ -16,3 +17,4 @@ stringData: {{ toYaml .Values.nfc_monitoring.thanos.sidecar.config | nindent 4 }} {{ end }} +{{ end }} diff --git a/templates/ServiceMonitor-prometheus.yaml b/templates/ServiceMonitor-prometheus.yaml index 86bc95e..148364f 100644 --- a/templates/ServiceMonitor-prometheus.yaml +++ b/templates/ServiceMonitor-prometheus.yaml @@ -28,6 +28,8 @@ spec: app.kubernetes.io/part-of: {{ $.Chart.Name }} {{ if .Values.nfc_monitoring.thanos.sidecar.enabled }} +{{ if .Values.nfc_monitoring.thanos.sidecar.config }} + --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor @@ -56,4 +58,5 @@ spec: app.kubernetes.io/name: thanos-sidecar app.kubernetes.io/part-of: {{ $.Chart.Name }} -{{ end }} \ No newline at end of file +{{ end }} +{{ end }} diff --git a/values.yaml b/values.yaml index c33d7e7..bdac68f 100644 --- a/values.yaml +++ b/values.yaml @@ -409,15 +409,16 @@ nfc_monitoring: sidecar: enabled: true - - config: - type: S3 - config: - bucket: "thanos-metrics" - endpoint: "rook-ceph-rgw-earth.ceph.svc:80" - access_key: "7J5NM2MNCDB4T4Y9OKJ5" - secret_key: "t9r69RzZdWEBL3NCKiUIpDk6j5625xc6HucusiGG" - insecure: true + + # Config must be specified for the sidecar to deploy + config: {} + # type: S3 + # config: + # bucket: "thanos-metrics" + # endpoint: "rook-ceph-rgw-earth.ceph.svc:80" + # access_key: "7J5NM2MNCDB4T4Y9OKJ5" + # secret_key: "t9r69RzZdWEBL3NCKiUIpDk6j5625xc6HucusiGG" + # insecure: true additions: