From 977c561a8f7c812a451190a53acb8775d10205de Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Fri, 19 Jan 2018 08:25:18 -0600 Subject: [PATCH] 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 --- prometheus-alertmanager/templates/pvc.yaml | 31 ------------------- .../templates/statefulset.yaml | 24 ++++++++------ prometheus-alertmanager/values.yaml | 4 +-- 3 files changed, 16 insertions(+), 43 deletions(-) delete mode 100644 prometheus-alertmanager/templates/pvc.yaml diff --git a/prometheus-alertmanager/templates/pvc.yaml b/prometheus-alertmanager/templates/pvc.yaml deleted file mode 100644 index 7bf281b8..00000000 --- a/prometheus-alertmanager/templates/pvc.yaml +++ /dev/null @@ -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 }} diff --git a/prometheus-alertmanager/templates/statefulset.yaml b/prometheus-alertmanager/templates/statefulset.yaml index fba99414..69e3efba 100644 --- a/prometheus-alertmanager/templates/statefulset.yaml +++ b/prometheus-alertmanager/templates/statefulset.yaml @@ -106,7 +106,7 @@ spec: mountPath: /tmp/alertmanager.sh subPath: alertmanager.sh readOnly: true - - name: storage + - name: alertmanager-data mountPath: /var/lib/alertmanager/data {{ if $mounts_alertmanager.volumeMounts }}{{ toYaml $mounts_alertmanager.volumeMounts | indent 12 }}{{ end }} volumes: @@ -119,13 +119,19 @@ spec: configMap: name: alertmanager-bin 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 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 }} diff --git a/prometheus-alertmanager/values.yaml b/prometheus-alertmanager/values.yaml index 6b5b4950..a8ae6f27 100644 --- a/prometheus-alertmanager/values.yaml +++ b/prometheus-alertmanager/values.yaml @@ -138,8 +138,7 @@ network: storage: enabled: true pvc: - name: alertmanager-pvc - access_mode: ReadWriteMany + access_mode: [ "ReadWriteOnce" ] requests: storage: 5Gi storage_class: general @@ -150,7 +149,6 @@ manifests: configmap_etc: true ingress: true job_image_repo_sync: true - pvc: true service: true service_discovery: true service_ingress: true