feat(thanos_sidecar): if enabled must also be configured for deploy to occur

!8
This commit is contained in:
2024-02-04 15:04:24 +09:30
parent 18649086b5
commit cd2bceec3a
5 changed files with 21 additions and 11 deletions

View File

@ -48,12 +48,14 @@ spec:
storage: storage:
{{- toYaml .Values.nfc_monitoring.prometheus.storage | nindent 4 }} {{- toYaml .Values.nfc_monitoring.prometheus.storage | nindent 4 }}
{{ if .Values.nfc_monitoring.thanos.sidecar.enabled }} {{ if .Values.nfc_monitoring.thanos.sidecar.enabled }}
{{ if .Values.nfc_monitoring.thanos.sidecar.config }}
thanos: thanos:
image: "{{ .Values.nfc_monitoring.thanos.image.name }}:{{ .Values.nfc_monitoring.thanos.image.tag }}" image: "{{ .Values.nfc_monitoring.thanos.image.name }}:{{ .Values.nfc_monitoring.thanos.image.tag }}"
objectStorageConfig: objectStorageConfig:
key: thanos.yaml key: thanos.yaml
name: thanos-sidecar-config name: thanos-sidecar-config
{{ end }} {{ end }}
{{ end }}
version: 2.42.0 version: 2.42.0
{{ if .Values.nfc_monitoring.prometheus.additional }} {{ if .Values.nfc_monitoring.prometheus.additional }}
{{ toYaml .Values.nfc_monitoring.prometheus.additional | nindent 2 }} {{ toYaml .Values.nfc_monitoring.prometheus.additional | nindent 2 }}

View File

@ -1,4 +1,5 @@
{{ if .Values.nfc_monitoring.thanos.sidecar.enabled }} {{ if .Values.nfc_monitoring.thanos.sidecar.enabled }}
{{ if .Values.nfc_monitoring.thanos.sidecar.config }}
--- ---
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule kind: PrometheusRule
@ -52,4 +53,5 @@ spec:
labels: labels:
severity: critical severity: critical
{{ end }} {{ end }}
{{ end }}

View File

@ -1,4 +1,5 @@
{{ if .Values.nfc_monitoring.thanos.sidecar.enabled }} {{ if .Values.nfc_monitoring.thanos.sidecar.enabled }}
{{ if .Values.nfc_monitoring.thanos.sidecar.config }}
--- ---
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
@ -16,3 +17,4 @@ stringData:
{{ toYaml .Values.nfc_monitoring.thanos.sidecar.config | nindent 4 }} {{ toYaml .Values.nfc_monitoring.thanos.sidecar.config | nindent 4 }}
{{ end }} {{ end }}
{{ end }}

View File

@ -28,6 +28,8 @@ spec:
app.kubernetes.io/part-of: {{ $.Chart.Name }} app.kubernetes.io/part-of: {{ $.Chart.Name }}
{{ if .Values.nfc_monitoring.thanos.sidecar.enabled }} {{ if .Values.nfc_monitoring.thanos.sidecar.enabled }}
{{ if .Values.nfc_monitoring.thanos.sidecar.config }}
--- ---
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor kind: ServiceMonitor
@ -56,4 +58,5 @@ spec:
app.kubernetes.io/name: thanos-sidecar app.kubernetes.io/name: thanos-sidecar
app.kubernetes.io/part-of: {{ $.Chart.Name }} app.kubernetes.io/part-of: {{ $.Chart.Name }}
{{ end }} {{ end }}
{{ end }}

View File

@ -409,15 +409,16 @@ nfc_monitoring:
sidecar: sidecar:
enabled: true enabled: true
config: # Config must be specified for the sidecar to deploy
type: S3 config: {}
config: # type: S3
bucket: "thanos-metrics" # config:
endpoint: "rook-ceph-rgw-earth.ceph.svc:80" # bucket: "thanos-metrics"
access_key: "7J5NM2MNCDB4T4Y9OKJ5" # endpoint: "rook-ceph-rgw-earth.ceph.svc:80"
secret_key: "t9r69RzZdWEBL3NCKiUIpDk6j5625xc6HucusiGG" # access_key: "7J5NM2MNCDB4T4Y9OKJ5"
insecure: true # secret_key: "t9r69RzZdWEBL3NCKiUIpDk6j5625xc6HucusiGG"
# insecure: true
additions: additions: