summaryrefslogtreecommitdiffstats
path: root/kubernetes
diff options
context:
space:
mode:
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>2019-12-06 18:27:53 +0100
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>2019-12-06 18:27:53 +0100
commit06a449bab3f4713a83f0415f5013bb5602e72e1f (patch)
tree40879b10eaf7feb49f4d787918e6ac2be2087a84 /kubernetes
parent72c71c0b832a169c03bcdbaa5997956e30f62c7c (diff)
[SO] 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 Change-Id: Ice44eda13aad44564d61f9e954cd11085a81d56f Issue-ID: OOM-1227 Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com>
Diffstat (limited to 'kubernetes')
-rw-r--r--kubernetes/so/charts/so-mariadb/templates/pv.yaml1
-rw-r--r--kubernetes/so/charts/so-mariadb/templates/pvc.yaml12
2 files changed, 2 insertions, 11 deletions
diff --git a/kubernetes/so/charts/so-mariadb/templates/pv.yaml b/kubernetes/so/charts/so-mariadb/templates/pv.yaml
index 5f5d09e2eb..f8315ef5f9 100644
--- a/kubernetes/so/charts/so-mariadb/templates/pv.yaml
+++ b/kubernetes/so/charts/so-mariadb/templates/pv.yaml
@@ -36,6 +36,7 @@ spec:
accessModes:
- {{ .Values.persistence.accessMode }}
persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+ storageClassName: "{{ include "common.fullname" . }}-data"
hostPath:
path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
{{- end }}
diff --git a/kubernetes/so/charts/so-mariadb/templates/pvc.yaml b/kubernetes/so/charts/so-mariadb/templates/pvc.yaml
index 92d5eed0c4..17ff7730c7 100644
--- a/kubernetes/so/charts/so-mariadb/templates/pvc.yaml
+++ b/kubernetes/so/charts/so-mariadb/templates/pvc.yaml
@@ -33,20 +33,10 @@ metadata:
{{ toYaml .Values.persistence.annotations | indent 4 }}
{{- end }}
spec:
- selector:
- matchLabels:
- name: {{ include "common.fullname" . }}-migration
accessModes:
- {{ .Values.persistence.accessMode }}
resources:
requests:
storage: {{ .Values.persistence.size }}
-{{- if .Values.persistence.storageClass }}
-{{- if (eq "-" .Values.persistence.storageClass) }}
- storageClassName: ""
-{{- else }}
- storageClassName: "{{ .Values.persistence.storageClass }}"
+ storageClassName: {{ include "common.storageClass" . }}
{{- end }}
-{{- end }}
-{{- end }}
-