Alertmanager: Use volumeclaimtemplate for storage

This removes the pvc in Alertmanager and changes the default
storage_class to readwriteonce.  Now that Alertmanager uses peer
meshing, it's not required for the replicas to share a common
volume claim

Change-Id: I24290264cb0e552a143a56faa753289f073c47b9
This commit is contained in:
Steve Wilkerson 2018-01-19 08:25:18 -06:00
parent 8a523c0afd
commit 977c561a8f
3 changed files with 16 additions and 43 deletions

View File

@ -1,31 +0,0 @@
{{/*
Copyright 2017 The Openstack-Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- if .Values.manifests.pvc }}
{{- $envAll := . }}
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ .Values.storage.pvc.name }}
spec:
accessModes:
- {{ .Values.storage.pvc.access_mode }}
resources:
requests:
storage: {{ .Values.storage.requests.storage }}
storageClassName: {{ .Values.storage.storage_class }}
{{- end }}

View File

@ -106,7 +106,7 @@ spec:
mountPath: /tmp/alertmanager.sh mountPath: /tmp/alertmanager.sh
subPath: alertmanager.sh subPath: alertmanager.sh
readOnly: true readOnly: true
- name: storage - name: alertmanager-data
mountPath: /var/lib/alertmanager/data mountPath: /var/lib/alertmanager/data
{{ if $mounts_alertmanager.volumeMounts }}{{ toYaml $mounts_alertmanager.volumeMounts | indent 12 }}{{ end }} {{ if $mounts_alertmanager.volumeMounts }}{{ toYaml $mounts_alertmanager.volumeMounts | indent 12 }}{{ end }}
volumes: volumes:
@ -119,13 +119,19 @@ spec:
configMap: configMap:
name: alertmanager-bin name: alertmanager-bin
defaultMode: 0555 defaultMode: 0555
{{- if .Values.storage.enabled }}
- name: storage
persistentVolumeClaim:
claimName: {{ .Values.storage.pvc.name }}
{{- else }}
- name: storage
emptyDir: {}
{{- end }}
{{ if $mounts_alertmanager.volumes }}{{ toYaml $mounts_alertmanager.volumes | indent 8 }}{{ end }} {{ if $mounts_alertmanager.volumes }}{{ toYaml $mounts_alertmanager.volumes | indent 8 }}{{ end }}
{{- if not .Values.storage.enabled }}
- name: alertmanager-data
emptyDir: {}
{{- else }}
volumeClaimTemplates:
- metadata:
name: alertmanager-data
spec:
accessModes: {{ .Values.storage.pvc.access_mode }}
resources:
requests:
storage: {{ .Values.storage.requests.storage }}
storageClassName: {{ .Values.storage.storage_class }}
{{- end }}
{{- end }} {{- end }}

View File

@ -138,8 +138,7 @@ network:
storage: storage:
enabled: true enabled: true
pvc: pvc:
name: alertmanager-pvc access_mode: [ "ReadWriteOnce" ]
access_mode: ReadWriteMany
requests: requests:
storage: 5Gi storage: 5Gi
storage_class: general storage_class: general
@ -150,7 +149,6 @@ manifests:
configmap_etc: true configmap_etc: true
ingress: true ingress: true
job_image_repo_sync: true job_image_repo_sync: true
pvc: true
service: true service: true
service_discovery: true service_discovery: true
service_ingress: true service_ingress: true