Skip to content

Commit

Permalink
Prometheus: provide options to use existing PVCs (helm#252)
Browse files Browse the repository at this point in the history
* Provide options to use existing PVCs

* Added persistentVolume.existingClaim options for alertmanager & server
* If defined, use those named PVCs. Else create new ones using template
* Documentation

* chart version bump
  • Loading branch information
mgoodness authored and prydonius committed Jan 19, 2017
1 parent 3e83da2 commit 7a2f100
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion stable/prometheus/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: prometheus
version: 2.0.0
version: 2.0.1
description: A Prometheus Helm chart for Kubernetes. Prometheus is a monitoring system and time series database.
home: https://prometheus.io/
sources:
Expand Down
2 changes: 2 additions & 0 deletions stable/prometheus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ The following tables lists the configurable parameters of the Prometheus chart a
| `alertmanager.name` | Alertmanager container name | `alertmanager` |
| `alertmanager.persistentVolume.enabled` | If true, AlertManager will create a Persistent Volume Claim | `true` |
| `alertmanager.persistentVolume.accessModes` | AlertManager data Persistent Volume access modes | `[ReadWriteOnce]` |
| `alertmanager.persistentVolume.existingClaim` | AlertManager data Persistent Volume existing claim name | |
| `alertmanager.persistentVolume.size` | AlertManager data Persistent Volume size | `2Gi` |
| `alertmanager.persistentVolume.storageClass` | AlertManager data Persistent Volume Storage Class | `volume.alpha.kubernetes.io/storage-class: default` |
| `alertmanager.resources` | Alertmanager resource requests and limits (YAML) |`requests: {cpu: 10m, memory: 32Mi}` |
Expand Down Expand Up @@ -81,6 +82,7 @@ The following tables lists the configurable parameters of the Prometheus chart a
| `server.persistentVolume.enabled` | If true, Server will create a Persistent Volume Claim | `false` |
| `server.persistentVolume.accessModes` | Server data Persistent Volume access modes | `[ReadWriteOnce]` |
| `server.persistentVolume.annotations` | Server data Persistent Volume annotations | `[]` |
| `server.persistentVolume.existingClaim` | Server data Persistent Volume existing claim name | |
| `server.persistentVolume.size` | Server data Persistent Volume size | `8Gi` |
| `server.persistentVolume.storageClass` | Server data Persistent Volume Storage Class | `volume.alpha.kubernetes.io/storage-class: default` |
| `server.resources` | Server resource requests and limits | `requests: {cpu: 500m, memory: 512Mi}` |
Expand Down
2 changes: 1 addition & 1 deletion stable/prometheus/templates/alertmanager-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ spec:
- name: storage-volume
{{- if .Values.alertmanager.persistentVolume.enabled }}
persistentVolumeClaim:
claimName: {{ template "alertmanager.fullname" . }}
claimName: {{ if .Values.alertmanager.persistentVolume.existingClaim }}{{ .Values.alertmanager.persistentVolume.existingClaim }}{{- else }}{{ template "alertmanager.fullname" . }}{{- end }}
{{- else }}
emptyDir: {}
{{- end -}}
2 changes: 2 additions & 0 deletions stable/prometheus/templates/alertmanager-pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if .Values.alertmanager.persistentVolume.enabled -}}
{{- if not .Values.alertmanager.persistentVolume.existingClaim -}}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
Expand Down Expand Up @@ -27,3 +28,4 @@ spec:
requests:
storage: {{ .Values.alertmanager.persistentVolume.size | quote }}
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion stable/prometheus/templates/server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ spec:
- name: storage-volume
{{- if .Values.server.persistentVolume.enabled }}
persistentVolumeClaim:
claimName: {{ template "server.fullname" . }}
claimName: {{ if .Values.server.persistentVolume.existingClaim }}{{ .Values.server.persistentVolume.existingClaim }}{{- else }}{{ template "server.fullname" . }}{{- end }}
{{- else }}
emptyDir: {}
{{- end -}}
2 changes: 2 additions & 0 deletions stable/prometheus/templates/server-pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if .Values.server.persistentVolume.enabled -}}
{{- if not .Values.server.persistentVolume.existingClaim -}}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
Expand Down Expand Up @@ -27,3 +28,4 @@ spec:
requests:
storage: {{ .Values.server.persistentVolume.size | quote }}
{{- end -}}
{{- end -}}
14 changes: 12 additions & 2 deletions stable/prometheus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ alertmanager:
name: alertmanager

persistentVolume:
## If true, AlertManager will create a Persistent Volume Claim
## If true, AlertManager will create/use a Persistent Volume Claim
## If false, use emptyDir
##
enabled: true
Expand All @@ -58,6 +58,11 @@ alertmanager:
##
# annotations:

## AlertManager data Persistent Volume existing claim name
## Requires alertmanager.persistentVolume.enabled: true
## If defined, PVC must be created manually before volume will be bound
# existingClaim:

## AlertManager data Persistent Volume size
##
size: 2Gi
Expand Down Expand Up @@ -192,7 +197,7 @@ server:
name: server

persistentVolume:
## If true, Server will create a Persistent Volume Claim
## If true, Server will create/use a Persistent Volume Claim
## If false, use emptyDir
##
enabled: true
Expand All @@ -208,6 +213,11 @@ server:
##
# annotations:

## Server data Persistent Volume existing claim name
## Requires server.persistentVolume.enabled: true
## If defined, PVC must be created manually before volume will be bound
# existingClaim:

## Server data Persistent Volume size
##
size: 8Gi
Expand Down

0 comments on commit 7a2f100

Please sign in to comment.