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

prometheus: switch to Kubernetes 1.6 storage class specification #1332

Merged
merged 2 commits into from
Aug 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a reasonable approach. Provides the necessary options for 1.6+, and users can still use on <1.6 by leaving storageClass unset and providing the annotation.

Ping @unguiculus @viglesiasce @lachie83 @prydonius @seanknox @linki @sameersbn @foxish: is this a/the pattern we want to adopt repo-wide?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK with me. Plus, now that v1.7 is out, we should formally deprecate v1.5 support and focus on v1.6 and v1.7.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK with me too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps also a note about providing the old annotations for clusters <1.6?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seanknox's comment indicated a deprecation of v1.5 support.

##
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