From 5d25996c2fa6364bc5ee44658eb743d3a7c24871 Mon Sep 17 00:00:00 2001 From: dgotlieb Date: Wed, 27 Sep 2023 13:56:45 +0300 Subject: [PATCH] [prometheus-rabbitmq-exporter] fix connection parameters not passing to the deployment (#3649) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * enable passing rabbitmq conection parameters Signed-off-by: Daniel Gotlieb * Update chart version Signed-off-by: dgotlieb * Update charts/prometheus-rabbitmq-exporter/Chart.yaml Signed-off-by: André Bauer --------- Signed-off-by: Daniel Gotlieb Signed-off-by: dgotlieb Signed-off-by: André Bauer Co-authored-by: Daniel Gotlieb Co-authored-by: MH Co-authored-by: André Bauer [alertmanager] Add if block to ingressClassName to use default ingressClass (#3824) * add-if-block-to-ingressClassName Signed-off-by: jmnote * Chart Version bumped Signed-off-by: jmnote --------- Signed-off-by: jmnote Co-authored-by: André Bauer [alertmanager] Add optional seperate ingress per replica (#3689) * [alertmanager] Add optional seperate ingress per replica Signed-off-by: Knut Götz * chore(alertmanger): bump chart version Signed-off-by: Knut Götz --------- Signed-off-by: Knut Götz Signed-off-by: André Bauer Co-authored-by: André Bauer Signed-off-by: peterabarr <90917602+peterabarr@users.noreply.github.com> [alertmanager] Add support for PVC retention policy in statefulset Fix Fix PVC policy Fix fmt Signed-off-by: peterabarr <90917602+peterabarr@users.noreply.github.com> Adjustments Remove ternary rm blank space Signed-off-by: peterabarr <90917602+peterabarr@users.noreply.github.com> Change chart version Signed-off-by: peterabarr <90917602+peterabarr@users.noreply.github.com> Json changes Signed-off-by: peterabarr <90917602+peterabarr@users.noreply.github.com> Add to templates file Signed-off-by: peterabarr <90917602+peterabarr@users.noreply.github.com> Statefulset fix Signed-off-by: peterabarr <90917602+peterabarr@users.noreply.github.com> Fixes Signed-off-by: peterabarr <90917602+peterabarr@users.noreply.github.com> --- alertmanager.kubeVersion | 0 charts/alertmanager/Chart.yaml | 2 +- charts/alertmanager/templates/_helpers.tpl | 7 +++ .../alertmanager/templates/statefulset.yaml | 5 ++ charts/alertmanager/values.schema.json | 53 ++++++++++++++++++- charts/alertmanager/values.yaml | 10 ++++ 6 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 alertmanager.kubeVersion diff --git a/alertmanager.kubeVersion b/alertmanager.kubeVersion new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/charts/alertmanager/Chart.yaml b/charts/alertmanager/Chart.yaml index 4b0884111b8d..842cae8d7d01 100644 --- a/charts/alertmanager/Chart.yaml +++ b/charts/alertmanager/Chart.yaml @@ -6,7 +6,7 @@ icon: https://raw.githubusercontent.com/prometheus/prometheus.github.io/master/a sources: - https://github.com/prometheus/alertmanager type: application -version: 1.7.0 +version: 1.8.0 appVersion: v0.26.0 kubeVersion: ">=1.19.0-0" keywords: diff --git a/charts/alertmanager/templates/_helpers.tpl b/charts/alertmanager/templates/_helpers.tpl index 827b6ee9f7da..b2c4f5cfc0a9 100644 --- a/charts/alertmanager/templates/_helpers.tpl +++ b/charts/alertmanager/templates/_helpers.tpl @@ -24,6 +24,13 @@ If release name contains chart name it will be used as a full name. {{- end }} {{- end }} +{{/* +Get KubeVersion removing pre-release information. +*/}} +{{- define "alertmanager.kubeVersion" -}} + {{- default .Capabilities.KubeVersion.Version (regexFind "v[0-9]+\\.[0-9]+\\.[0-9]+" .Capabilities.KubeVersion.Version) -}} +{{- end -}} + {{/* Create chart name and version as used by the chart label. */}} diff --git a/charts/alertmanager/templates/statefulset.yaml b/charts/alertmanager/templates/statefulset.yaml index 25d81a921345..0e5789a1c419 100644 --- a/charts/alertmanager/templates/statefulset.yaml +++ b/charts/alertmanager/templates/statefulset.yaml @@ -11,6 +11,11 @@ metadata: {{- end }} namespace: {{ include "alertmanager.namespace" . }} spec: + {{- if semverCompare ">= 1.27-0" .Capabilities.KubeVersion.Version }} + persistentVolumeClaimRetentionPolicy: + whenDeleted: {{ .Values.statefulSet.persistentVolumeClaimRetentionPolicy.whenDeleted }} + whenScaled: {{ .Values.statefulSet.persistentVolumeClaimRetentionPolicy.whenScaled }} + {{- end }} replicas: {{ .Values.replicaCount }} revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} selector: diff --git a/charts/alertmanager/values.schema.json b/charts/alertmanager/values.schema.json index 172dbcf3e67b..8770a294683e 100644 --- a/charts/alertmanager/values.schema.json +++ b/charts/alertmanager/values.schema.json @@ -747,7 +747,56 @@ "properties": { "annotations": { "type": "object" - } + }, + "enabled": { + "type": "boolean" + }, + "headless": { + "type": "object", + "properties": { + "annotations": { + "type": "object" + }, + "gRPC": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "servicePort": { + "type": "integer" + } + } + }, + "labels": { + "type": "object" + }, + "servicePort": { + "type": "integer" + } + } + }, + "labels": { + "type": "object" + }, + "podManagementPolicy": { + "type": "string" + }, + "persistentVolumeClaimRetentionPolicy": { + "type": "object", + "properties": { + "whenDeleted": { + "type": "string", + "enum": ["Retain", "Delete"] + }, + "whenScaled": { + "type": "string", + "enum": ["Retain", "Delete"] + } + }, + "additionalProperties": false, + "required": ["whenDeleted", "whenScaled"] + } } }, "podAnnotations": { @@ -912,4 +961,4 @@ } } } -} +} \ No newline at end of file diff --git a/charts/alertmanager/values.yaml b/charts/alertmanager/values.yaml index fa3b355a5114..b860a49593e0 100644 --- a/charts/alertmanager/values.yaml +++ b/charts/alertmanager/values.yaml @@ -258,6 +258,16 @@ persistence: - ReadWriteOnce size: 50Mi + ## Statefulset's persistent volume claim retention policy + ## pvcDeleteOnStsDelete and pvcDeleteOnStsScale determine whether + ## statefulset's PVCs are deleted (true) or retained (false) on scaling down + ## and deleting statefulset, respectively. Requires 1.27.0+. + ## Ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention + ## + persistentVolumeClaimRetentionPolicy: + whenDeleted: Retain + whenScaled: Retain + configAnnotations: {} ## For example if you want to provide private data from a secret vault ## https://github.com/banzaicloud/bank-vaults/tree/main/charts/vault-secrets-webhook