From db7b387af130cebdc3bac4931c27ecf9f2408231 Mon Sep 17 00:00:00 2001 From: Stefan Andres Date: Tue, 26 Sep 2023 11:10:26 +0200 Subject: [PATCH 1/2] Make deployment updateStrategy variable. There are scenarios where the pod can get scraped twice by the ServiceMonitor. This will leave duplicate series in prometheus that may lead to many-to-many queries causing broken grafana dashboards. With this change updateStrategy can be changed to Recreate for those cases. --- charts/opencost/Chart.yaml | 2 +- charts/opencost/templates/deployment.yaml | 6 +----- charts/opencost/values.yaml | 6 ++++++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/charts/opencost/Chart.yaml b/charts/opencost/Chart.yaml index 1b3adaf..4f3cfc4 100755 --- a/charts/opencost/Chart.yaml +++ b/charts/opencost/Chart.yaml @@ -9,7 +9,7 @@ keywords: - kubecost - opencost - monitoring -version: 1.20.3 +version: 1.21.0 maintainers: - name: mattray url: https://mattray.dev diff --git a/charts/opencost/templates/deployment.yaml b/charts/opencost/templates/deployment.yaml index 807bce3..25a45e0 100644 --- a/charts/opencost/templates/deployment.yaml +++ b/charts/opencost/templates/deployment.yaml @@ -11,11 +11,7 @@ spec: replicas: {{ .Values.opencost.exporter.replicas }} selector: matchLabels: {{- include "opencost.selectorLabels" . | nindent 6 }} - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 1 - type: RollingUpdate + strategy: {{ toYaml .Values.updateStrategy | nindent 4 }} template: metadata: labels: diff --git a/charts/opencost/values.yaml b/charts/opencost/values.yaml index dcb33b5..1a104e7 100644 --- a/charts/opencost/values.yaml +++ b/charts/opencost/values.yaml @@ -18,6 +18,12 @@ serviceAccount: # -- Whether pods running as this service account should have an API token automatically mounted automountServiceAccountToken: true +# -- Strategy to be used for the Deployment +updateStrategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + type: RollingUpdate # -- Annotations to add to the all the resources annotations: {} # -- Annotations to add to the OpenCost Pod From ccc42f7039f8adf267ddb8361098c884f74f4209 Mon Sep 17 00:00:00 2001 From: Matt Ray Date: Thu, 19 Oct 2023 15:30:06 +1100 Subject: [PATCH 2/2] Update chart versions to 1.21.3 Signed-off-by: Matt Ray --- charts/opencost/Chart.yaml | 2 +- charts/opencost/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/opencost/Chart.yaml b/charts/opencost/Chart.yaml index 4f3cfc4..727c48b 100755 --- a/charts/opencost/Chart.yaml +++ b/charts/opencost/Chart.yaml @@ -9,7 +9,7 @@ keywords: - kubecost - opencost - monitoring -version: 1.21.0 +version: 1.21.3 maintainers: - name: mattray url: https://mattray.dev diff --git a/charts/opencost/README.md b/charts/opencost/README.md index 69bf005..684224f 100644 --- a/charts/opencost/README.md +++ b/charts/opencost/README.md @@ -2,7 +2,7 @@ OpenCost and OpenCost UI -![Version: 1.20.2](https://img.shields.io/badge/Version-1.20.2-informational?style=flat-square) +![Version: 1.21.3](https://img.shields.io/badge/Version-1.21.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.106.3](https://img.shields.io/badge/AppVersion-1.106.3-informational?style=flat-square)