Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
prometheus: switch to Kubernetes 1.6 storage class specification (#1332)
Browse files Browse the repository at this point in the history
* prometheus: switch to Kubernetes 1.6 storage class specification

Ditching the alpha storage class annotation and using the 1.6 style specification instead brings the following benefits:

- a standard way to specify the default provisioner
- a mechanism to disble the dynamic provisioner

Unfortunately, go template makes the second one hacky.   See helm/helm#2600 for more details.   So instead of using an empty string to disable the dynamic provisioner, this PR uses "-".

* Bump major version
  • Loading branch information
bryanlarsen authored and mgoodness committed Aug 1, 2017
1 parent 892f5d8 commit 27af14e
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 21 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: 3.2.0
version: 4.0.0
description: Prometheus is a monitoring system and time series database.
home: https://prometheus.io/
icon: https://raw.githubusercontent.com/prometheus/prometheus.github.io/master/assets/prometheus_logo-cb55bb5c346.png
Expand Down
4 changes: 2 additions & 2 deletions stable/prometheus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Parameter | Description | Default
`alertmanager.persistentVolume.existingClaim` | alertmanager data Persistent Volume existing claim name | `""`
`alertmanager.persistentVolume.mountPath` | alertmanager data Persistent Volume mount root path | `/data`
`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.persistentVolume.storageClass` | alertmanager data Persistent Volume Storage Class | `unset
`alertmanager.persistentVolume.subPath` | Subdirectory of alertmanager data Persistent Volume to mount | `""`
`alertmanager.podAnnotations` | annotations to be added to alertmanager pods | `{}`
`alertmanager.replicaCount` | desired number of alertmanager pods | `1`
Expand Down Expand Up @@ -131,7 +131,7 @@ Parameter | Description | Default
`server.persistentVolume.existingClaim` | Prometheus server data Persistent Volume existing claim name | `""`
`server.persistentVolume.mountPath` | Prometheus server data Persistent Volume mount root path | `/data`
`server.persistentVolume.size` | Prometheus server data Persistent Volume size | `8Gi`
`server.persistentVolume.storageClass` | Prometheus server data Persistent Volume Storage Class | `volume.alpha.kubernetes.io/storage-class: default`
`server.persistentVolume.storageClass` | Prometheus server data Persistent Volume Storage Class | unset
`server.persistentVolume.subPath` | Subdirectory of Prometheus server data Persistent Volume to mount | `""`
`server.podAnnotations` | annotations to be added to Prometheus server pods | `{}`
`server.replicaCount` | desired number of Prometheus server pods | `1`
Expand Down
14 changes: 8 additions & 6 deletions stable/prometheus/templates/alertmanager-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
{{- if .Values.alertmanager.persistentVolume.storageClass }}
volume.beta.kubernetes.io/storage-class: "{{ .Values.alertmanager.persistentVolume.storageClass }}"
{{- else }}
volume.alpha.kubernetes.io/storage-class: default
{{- end }}
{{- if .Values.alertmanager.persistentVolume.annotations }}
annotations:
{{ toYaml .Values.alertmanager.persistentVolume.annotations | indent 4 }}
{{- end }}
labels:
Expand All @@ -22,6 +17,13 @@ metadata:
spec:
accessModes:
{{ toYaml .Values.alertmanager.persistentVolume.accessModes | indent 4 }}
{{- if .Values.alertmanager.persistentVolume.storageClass }}
{{- if (eq "-" .Values.alertmanager.persistentVolume.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.alertmanager.persistentVolume.storageClass }}"
{{- end }}
{{- end }}
resources:
requests:
storage: "{{ .Values.alertmanager.persistentVolume.size }}"
Expand Down
14 changes: 8 additions & 6 deletions stable/prometheus/templates/server-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
{{- if .Values.server.persistentVolume.storageClass }}
volume.beta.kubernetes.io/storage-class: "{{ .Values.server.persistentVolume.storageClass }}"
{{- else }}
volume.alpha.kubernetes.io/storage-class: default
{{- end }}
{{- if .Values.server.persistentVolume.annotations }}
annotations:
{{ toYaml .Values.server.persistentVolume.annotations | indent 4 }}
{{- end }}
labels:
Expand All @@ -22,6 +17,13 @@ metadata:
spec:
accessModes:
{{ toYaml .Values.server.persistentVolume.accessModes | indent 4 }}
{{- if .Values.server.persistentVolume.storageClass }}
{{- if (eq "-" .Values.server.persistentVolume.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.server.persistentVolume.storageClass }}"
{{- end }}
{{- end }}
resources:
requests:
storage: "{{ .Values.server.persistentVolume.size }}"
Expand Down
18 changes: 12 additions & 6 deletions stable/prometheus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,13 @@ alertmanager:
size: 2Gi

## alertmanager data Persistent Volume Storage Class
## If defined, volume.beta.kubernetes.io/storage-class: <storageClass>
## Default: volume.alpha.kubernetes.io/storage-class: default
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack)
##
storageClass: ""
# storageClass: "-"

## Subdirectory of alertmanager data Persistent Volume to mount
## Useful if the volume's root directory is not empty
Expand Down Expand Up @@ -360,10 +363,13 @@ server:
size: 8Gi

## Prometheus server data Persistent Volume Storage Class
## If defined, volume.beta.kubernetes.io/storage-class: <storageClass>
## Default: volume.alpha.kubernetes.io/storage-class: default
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack)
##
storageClass: ""
# storageClass: "-"

## Subdirectory of Prometheus server data Persistent Volume to mount
## Useful if the volume's root directory is not empty
Expand Down

0 comments on commit 27af14e

Please sign in to comment.