Skip to content

Commit

Permalink
Support configuring Prometheus retention
Browse files Browse the repository at this point in the history
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
welteki authored and alexellis committed Apr 30, 2024
1 parent 92262d4 commit 6c9cfaf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions chart/openfaas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -651,4 +651,6 @@ For legacy scaling in OpenFaaS Community Edition.
| ----------------------- | ---------------------------------- | ---------------------------------------------------------- |
| `prometheus.create` | Create the Prometheus component | `true` |
| `prometheus.image` | Container image used for prometheus | See [values.yaml](./values.yaml) |
| `prometheus.retention.time` | When to remove old data from the prometheus db. | `15d` |
| `prometheus.retention.size` | The maximum number of bytes of storage blocks to retain. Units supported: B, KB, MB, GB, TB, PB, EB. 0 meaning disabled. See: [Prometheus storage](https://prometheus.io/docs/prometheus/latest/storage/#operational-aspects)| `0` |
| `prometheus.resources` | Resource limits and requests for prometheus containers | See [values.yaml](./values.yaml) |
6 changes: 6 additions & 0 deletions chart/openfaas/templates/prometheus-dep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ spec:
command:
- "prometheus"
- "--config.file=/etc/prometheus/prometheus.yml"
{{- if .Values.prometheus.retention.time }}
- "--storage.tsdb.retention.time={{.Values.prometheus.retention.time}}"
{{- end }}
{{- if .Values.prometheus.retention.size }}
- "--storage.tsdb.retention.size={{.Values.prometheus.retention.size}}"
{{- end }}
imagePullPolicy: {{ .Values.openfaasImagePullPolicy }}
livenessProbe:
{{- if .Values.httpProbe }}
Expand Down
2 changes: 2 additions & 0 deletions chart/openfaas/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@ iam:
prometheus:
image: prom/prometheus:v2.51.2
create: true
retention:
time: 15d
resources:
requests:
memory: "512Mi"
Expand Down

0 comments on commit 6c9cfaf

Please sign in to comment.