Skip to content

Commit

Permalink
Make deployment updateStrategy variable.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stefanandres committed Oct 14, 2023
1 parent 7116423 commit db7b387
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/opencost/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keywords:
- kubecost
- opencost
- monitoring
version: 1.20.3
version: 1.21.0
maintainers:
- name: mattray
url: https://mattray.dev
Expand Down
6 changes: 1 addition & 5 deletions charts/opencost/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions charts/opencost/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit db7b387

Please sign in to comment.