From d1e8a2dbdd5ec94d61cf8aac29d881edeedbe67d Mon Sep 17 00:00:00 2001 From: Luvpreet Singh Date: Thu, 7 Sep 2023 20:19:22 +0530 Subject: [PATCH] [kube-state-metrics] add option to set updateStrategy to Recreate (#3766) * [kube-state-metrics] add option to set updateStrategy to Recreate Signed-off-by: Luvpreet Singh --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/deployment.yaml | 4 ++++ charts/kube-state-metrics/values.yaml | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 8367bb441b40..5c997ed0b501 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -7,7 +7,7 @@ keywords: - prometheus - kubernetes type: application -version: 5.12.1 +version: 5.13.0 appVersion: 2.10.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/deployment.yaml b/charts/kube-state-metrics/templates/deployment.yaml index 31aa6101818d..69a387a8cd30 100644 --- a/charts/kube-state-metrics/templates/deployment.yaml +++ b/charts/kube-state-metrics/templates/deployment.yaml @@ -18,6 +18,10 @@ spec: matchLabels: {{- include "kube-state-metrics.selectorLabels" . | indent 6 }} replicas: {{ .Values.replicas }} + {{- if not .Values.autosharding.enabled }} + strategy: + type: {{ .Values.updateStrategy | default "RollingUpdate" }} + {{- end }} revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} {{- if .Values.autosharding.enabled }} serviceName: {{ template "kube-state-metrics.fullname" . }} diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 00eabab6ab09..29f59524d769 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -37,6 +37,9 @@ autosharding: replicas: 1 +# Change the deployment strategy when autosharding is disabled +# updateStrategy: Recreate + # Number of old history to retain to allow rollback # Default Kubernetes value is set to 10 revisionHistoryLimit: 10