Skip to content

Commit

Permalink
Ability to customize daemonset update strategy (#10)
Browse files Browse the repository at this point in the history
* Add ability to override updateStrategy of daemonset

The default behavior of maxUnavailable=1 works well most of the time,
but can take some time when rolling out a change to a larger cluster.

Making this customizable adds flexibility to this helm chart so that it
works well in larger and smaller clusters

Inspired by helm/charts#20858 which added this
same flexibility to the node-exporter helm chart

* Small typo in values.yaml
  • Loading branch information
jaspermarcus authored Sep 1, 2020
1 parent 012d5e3 commit 9c344c8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The following table lists the configurable parameters of the process exporter ch
| `readinessProbe.periodSeconds` | Amount of seconds between the probes | `10` |
| `readinessProbe.failureThreshold` | Amount of probe failures before the pod is restared | `3` |
| `readinessProbe.successThreshold` | Amount of consecutive probe successes to mark the pod as ready | `1` |

| `updateStrategy` | Update strategy for the daemonset | `Rolling update with 1 max unavailable` |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

```console
Expand Down
2 changes: 1 addition & 1 deletion charts/prometheus-process-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: "0.4.0"
description: A Helm chart for prometheus process-exporter
name: prometheus-process-exporter
version: 0.4.1
version: 0.4.2
home: https://github.com/mumoshu/prometheus-process-exporter
sources:
- https://github.com/ncabatoff/process-exporter
Expand Down
6 changes: 3 additions & 3 deletions charts/prometheus-process-exporter/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ spec:
matchLabels:
app: {{ template "prometheus-process-exporter.name" . }}
release: {{ .Release.Name }}
{{- if .Values.updateStrategy }}
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
{{ toYaml .Values.updateStrategy | indent 4 }}
{{- end }}
template:
metadata:
labels: {{ include "prometheus-process-exporter.labels" . | indent 8 }}
Expand Down
10 changes: 9 additions & 1 deletion charts/prometheus-process-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ image:
tag: 0.5.0
pullPolicy: IfNotPresent

## Specify entries of `process_names:` in the process-expoter config
## Specify entries of `process_names:` in the process-exporter config
## See https://github.com/ncabatoff/process-exporter/tree/master#using-a-config-file
groups:
- comm:
Expand Down Expand Up @@ -37,6 +37,14 @@ service:
# Annotations to add to the pod
podAnnotations: {}

# Set to Kubernetes default updateStrategy by default.
# See https://kubernetes.io/docs/tasks/manage-daemon/update-daemon-set/#daemonset-update-strategy for
# supported configurations.
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
Expand Down

0 comments on commit 9c344c8

Please sign in to comment.