diff --git a/prometheus-alertmanager/templates/pvc.yaml b/prometheus-alertmanager/templates/pvc.yaml deleted file mode 100644 index 7bf281b8d5..0000000000 --- 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 fba99414dc..69e3efbacb 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 6b5b495043..a8ae6f2783 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