Skip to content

Commit

Permalink
[prometheus] Make emptyDir settings consistent across components (vmw…
Browse files Browse the repository at this point in the history
…are-tanzu#243)

Currently only prometheus server takes `emptyDir.sizeLimit` for
`deployment` but not for `statefulset`. And alertmanager has no notion
about `emptyDir.sizeLimit` at all.

This change fixes that by following existing pattern of prometheus
server deployment spec, to allow `sizeLimit` to be set for both `server`
and `alertmanager`, regardless it is a deployment spec or statefulset.

On the pushgateway side, existing comment string in `values.yaml`
suggests if `persistentVolume.enabled` set to false, `emptyDir` will be
used. But that's actually not the case. Since the existing pushgateway
deployment spec by default has persistent volume turned off and doesn't
specify emptyDir at all (neither in volume nor  volumeMount), this
change fixes the inconsistency by updating the comment string in
values.yaml

Signed-off-by: Qiu Yu <[email protected]>
Signed-off-by: Torsten Walter <[email protected]>
  • Loading branch information
unicell authored and Torsten Walter committed Oct 26, 2020
1 parent 228bf51 commit 7235a4c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/prometheus/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: prometheus
version: 11.16.3
version: 11.16.4
appVersion: 2.21.0
description: Prometheus is a monitoring system and time series database.
home: https://prometheus.io/
Expand Down
7 changes: 6 additions & 1 deletion charts/prometheus/templates/alertmanager/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ spec:
persistentVolumeClaim:
claimName: {{ if .Values.alertmanager.persistentVolume.existingClaim }}{{ .Values.alertmanager.persistentVolume.existingClaim }}{{- else }}{{ template "prometheus.alertmanager.fullname" . }}{{- end }}
{{- else }}
emptyDir: {}
emptyDir:
{{- if .Values.alertmanager.emptyDir.sizeLimit }}
sizeLimit: {{ .Values.alertmanager.emptyDir.sizeLimit }}
{{- else }}
{}
{{- end -}}
{{- end -}}
{{- end }}
7 changes: 6 additions & 1 deletion charts/prometheus/templates/alertmanager/sts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ spec:
{{- end }}
{{- else }}
- name: storage-volume
emptyDir: {}
emptyDir:
{{- if .Values.alertmanager.emptyDir.sizeLimit }}
sizeLimit: {{ .Values.alertmanager.emptyDir.sizeLimit }}
{{- else }}
{}
{{- end -}}
{{- end }}
{{- end }}
7 changes: 6 additions & 1 deletion charts/prometheus/templates/server/sts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,12 @@ spec:
{{- end }}
{{- else }}
- name: storage-volume
emptyDir: {}
emptyDir:
{{- if .Values.server.emptyDir.sizeLimit }}
sizeLimit: {{ .Values.server.emptyDir.sizeLimit }}
{{- else }}
{}
{{- end -}}
{{- end }}
{{- end }}
{{- end }}
8 changes: 7 additions & 1 deletion charts/prometheus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ alertmanager:
##
subPath: ""

emptyDir:
## alertmanager emptyDir volume size limit
##
sizeLimit: ""

## Annotations to be added to alertmanager pods
##
podAnnotations: {}
Expand Down Expand Up @@ -821,6 +826,8 @@ server:
subPath: ""

emptyDir:
## Prometheus server emptyDir volume size limit
##
sizeLimit: ""

## Annotations to be added to Prometheus server pods
Expand Down Expand Up @@ -1114,7 +1121,6 @@ pushgateway:

persistentVolume:
## If true, pushgateway will create/use a Persistent Volume Claim
## If false, use emptyDir
##
enabled: false

Expand Down

0 comments on commit 7235a4c

Please sign in to comment.