diff --git a/prometheus/templates/pvc.yaml b/prometheus/templates/pvc.yaml deleted file mode 100644 index 7bf281b8d..000000000 --- a/prometheus/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/templates/statefulset.yaml b/prometheus/templates/statefulset.yaml index 52506b638..5e13e85c4 100644 --- a/prometheus/templates/statefulset.yaml +++ b/prometheus/templates/statefulset.yaml @@ -158,13 +158,19 @@ spec: configMap: name: prometheus-bin defaultMode: 0555 - {{- if .Values.storage.enabled }} - - name: storage - persistentVolumeClaim: - claimName: {{ .Values.storage.pvc.name }} - {{- else }} +{{ if $mounts_prometheus.volumes }}{{ toYaml $mounts_prometheus.volumes | indent 8 }}{{ end }} +{{- if not .Values.storage.enabled }} - name: storage emptyDir: {} - {{- end }} -{{ if $mounts_prometheus.volumes }}{{ toYaml $mounts_prometheus.volumes | indent 8 }}{{ end }} +{{- else }} + volumeClaimTemplates: + - metadata: + name: storage + 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/values.yaml b/prometheus/values.yaml index 2cbbce35f..0746ffa6a 100644 --- a/prometheus/values.yaml +++ b/prometheus/values.yaml @@ -165,7 +165,7 @@ storage: enabled: true pvc: name: prometheus-pvc - access_mode: ReadWriteMany + access_mode: [ "ReadWriteOnce" ] requests: storage: 5Gi storage_class: general