diff options
author | Sylvain Desbureaux <sylvain.desbureaux@orange.com> | 2019-12-09 10:43:54 +0100 |
---|---|---|
committer | Sylvain Desbureaux <sylvain.desbureaux@orange.com> | 2019-12-09 10:43:54 +0100 |
commit | 09b40ae930ae269f8c8523512f272ce985238c20 (patch) | |
tree | 844b3603522c968932f0738dd8dbee546eb6b5cf /kubernetes | |
parent | 72c71c0b832a169c03bcdbaa5997956e30f62c7c (diff) |
[Modeling] 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: I337e760ea71ec57c4f593e068c3cf6ea548a3cfc
Issue-ID: OOM-1227
Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com>
Diffstat (limited to 'kubernetes')
-rw-r--r-- | kubernetes/modeling/charts/modeling-etsicatalog/templates/pv.yaml | 5 | ||||
-rw-r--r-- | kubernetes/modeling/charts/modeling-etsicatalog/templates/pvc.yaml | 13 |
2 files changed, 6 insertions, 12 deletions
diff --git a/kubernetes/modeling/charts/modeling-etsicatalog/templates/pv.yaml b/kubernetes/modeling/charts/modeling-etsicatalog/templates/pv.yaml index d1e1b04121..68696fbccd 100644 --- a/kubernetes/modeling/charts/modeling-etsicatalog/templates/pv.yaml +++ b/kubernetes/modeling/charts/modeling-etsicatalog/templates/pv.yaml @@ -14,6 +14,7 @@ # limitations under the License. */}} {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} +{{- if eq "True" (include "common.needPV" .) -}} kind: PersistentVolume apiVersion: v1 metadata: @@ -31,6 +32,8 @@ 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 -}}
\ No newline at end of file +{{- end -}} +{{- end -}} diff --git a/kubernetes/modeling/charts/modeling-etsicatalog/templates/pvc.yaml b/kubernetes/modeling/charts/modeling-etsicatalog/templates/pvc.yaml index 74ba690fa6..d3d5d9e0a4 100644 --- a/kubernetes/modeling/charts/modeling-etsicatalog/templates/pvc.yaml +++ b/kubernetes/modeling/charts/modeling-etsicatalog/templates/pvc.yaml @@ -29,19 +29,10 @@ metadata: {{ toYaml .Values.persistence.annotations | indent 4 }} {{- end }} spec: - selector: - matchLabels: - name: {{ include "common.fullname" . }} accessModes: - {{ .Values.persistence.accessMode }} + storageClassName: {{ include "common.storageClass" . }} resources: requests: storage: {{ .Values.persistence.size }} -{{- if .Values.persistence.storageClass }} -{{- if (eq "-" .Values.persistence.storageClass) }} - storageClassName: "" -{{- else }} - storageClassName: "{{ .Values.persistence.storageClass }}" -{{- end }} -{{- end }} -{{- end -}}
\ No newline at end of file +{{- end -}} |