From 03c36f95a0c287bf866acea7ba8bdbf72e578155 Mon Sep 17 00:00:00 2001 From: Sylvain Desbureaux Date: Fri, 29 Nov 2019 15:22:29 +0100 Subject: [DCAE] Use global storage templates for PVC OOM has now templates in order to create the needed PVC, using: * a PV with a specific class when using a common nfs mount path between nodes (sames as today use) --> is the default behavior today * or a storage class if we want to use dynamic PV. On this case, we use (in order of priority): - persistence.storageClassOverride if set on the chart - global.persistence.storageClass if set globally - persistence.storageClass if set on the chart I've also used a "range" for PV creation of redis in order to have only the needed number. Change-Id: I6bb326f8aaece11bcf503e9300e5c39a87214f81 Issue-ID: OOM-1227 Signed-off-by: Sylvain Desbureaux --- .../components/dcae-redis/templates/statefulset.yaml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'kubernetes/dcaegen2/components/dcae-redis/templates/statefulset.yaml') diff --git a/kubernetes/dcaegen2/components/dcae-redis/templates/statefulset.yaml b/kubernetes/dcaegen2/components/dcae-redis/templates/statefulset.yaml index 5a5b220e61..d5fa6340d3 100644 --- a/kubernetes/dcaegen2/components/dcae-redis/templates/statefulset.yaml +++ b/kubernetes/dcaegen2/components/dcae-redis/templates/statefulset.yaml @@ -96,23 +96,27 @@ spec: - name: {{ include "common.fullname" . }}-scripts configMap: name: {{ include "common.fullname" . }}-scripts - defaultMode: 0755 + defaultMode: 0755 - name: localtime hostPath: path: /etc/localtime + {{- if not .Values.persistence.enabled }} + - name: {{ include "common.fullname" . }}-data + emptyDir: {} + {{- end }} imagePullSecrets: - name: "{{ include "common.namespace" . }}-docker-registry-key" + {{- if .Values.persistence.enabled }} volumeClaimTemplates: - metadata: name: {{ include "common.fullname" . }}-data labels: - name: {{ include "common.fullname" . }} + name: {{ include "common.fullname" . }} spec: - accessModes: [ {{ .Values.persistence.accessMode }} ] - storageClassName: manual + accessModes: + - {{ .Values.persistence.accessMode | quote }} + storageClassName: {{ include "common.storageClass" . }} resources: requests: - storage: {{ .Values.persistence.size }} - selector: - matchLabels: - name: {{ include "common.fullname" . }} + storage: {{ .Values.persistence.size | quote}} + {{- end }} -- cgit 1.2.3-korg